The man, who was not named for legal reasons, had his jail term increased from a previous one-year sentence set by a district court in June.
In its ruling, the Court of Appeal for Western Sweden found the man guilty of aggravated assault for attempting to make his girlfriend of eight years miscarry by giving her a yoghurt containing three ground-up pills. The sentence also included a more minor count of assault.
The court documents said the woman had decided to have the baby even though he felt he was not ready to be a father. The man ordered some pills on the Internet and fooled his doctor into prescribing others for another condition.
The woman ate the yoghurt and suffered severe stomach pains and vaginal bleeding.
When she later realized what she had eaten, she decided to have an abortion, fearing that the fetus had been permanently damaged by the pills.
The defendant's lawyer, Lars Boberg, said his client would most likely appeal the ruling.