Neither guard “was hurt and were able to return safely to their family,” prison spokeswoman Stina Lyles told AFP.
The inmates, both doing time for murder at the Hällby high security prison near the town of Eskilstuna, managed to force themselves into an area reserved only for guards at about 12.30pm, said another prison official, Torkel Omnell.
There, they took two guards hostage who were in the area at the time.
“We quickly sent in a mediator” and called the police, Omnell said.
According to Swedish media reports, the hostage-takers made two demands – a helicopter to escape and 20 pizzas for the other inmates.
“Yes, the pizzas were delivered,” jail spokeswoman Lyles said.
Swedish media reported that one guard was exchanged for the pizzas at around 7pm, and the other was released two and a half hours later.
The two inmates were taken to the police station for questioning for “kidnapping”, police said.