All eight gunmen were also killed when US and Iraqi forces mounted a joint operation to rescue worshippers held hostage in the Sayidat al-Nejat church in the Karrada neighbourhood.
The gunmen had stormed the church during evening mass after killing two guards at the nearby headquarters of the Baghdad stock exchange.
"We released the hostages but unfortunately seven of them were killed and 20 of them wounded," an interior ministry official told AFP.
A defence ministry official said 13 were hurt in the rescue operation and that the gunmen had been holding 40 hostages.
One of the freed hostages, an 18-year-old man, said that the first thing the gunmen did when they entered the church was to shoot the priest.
"The entered the church with their weapons, wearing military uniforms. They came into the prayer hall, and immediately killed the priest," said the young man who did declined to give his name.
All the hostages had been huddled into the main prayer hall when the gunbattles began with security forces, he said.
"We heard a lot of gunfire and explosions, and some people were hurt from falling windows, doors and debris," he added.
Officials said that nine gunmen had stormed the church in central Baghdad but one of them blew himself up by activating a suicide belt he was wearing earlier in the evening when police made a first attempt to enter the church.
"We killed the eight terrorists inside the church," an Iraqi soldier said.
Officials refused to speak about casualties among security forces.
"We came here to help the police and army free the hostages, and we released them with the help of the Americans," a member of Iraq’s anti-terrorist unit told AFP.
An AFP reporter saw US soldiers at the scene.
The US military officially ended combat operations in Iraq at the end of August, but 50,000 troops still remain in the country.
Helicopters hovered overhead and loud explosions and gunfire were heard, shortly after officials said they were preparing to storm the church.
Two guards at the stock exchange were killed in clashes with the gunmen trying to battle their way into the building earlier on Sunday, an interior ministry official said.
He said the attackers detonated a bomb in a car parked close wounding four civilians and escaped, fleeing to the Sayidat al-Nejat church which was among six targeted by deadly car bombings on August 1, 2004.
The Chaldean bishop of Baghdad, Bishop Shlimoune Wardouni earlier told AFP that gunmen were demanding the release of detainees held in Iraq and Egypt and that two priests were among the hostages.
The Vatican expressed regret over the hostage drama and called for a swift resolution.
"It’s a very sad situation, which confirms the difficult situation in which Christians live in the country," Father Federico Lombardi told AFP.
"We are following the situation closely and hope for a rapid solution, without violence or further victims," he said.
Violence has abated in Iraq since its peak in 2006-2007, but deadly bombings, gunfights and kidnappings are still routine.
Iraq’s Christians have been frequently the target of violence, including murder and abductions, over the past seven years.
Hundreds of Iraqi Christians have been killed and several churches attacked since the US-led invasion to oust Saddam Hussein in 2003.
Around 800,000 Christians lived in Iraq in 2003 but their number has since shrunk to 550,000 as members of the community have fled abroad, according to Christian leaders.