It said the military retained control of parts of the airport but six soldiers had died and 16 were wounded.
In the centre of the rebel-held city, shelling hit a bus, killing 13 people.
Rebels paraded captured Ukrainian soldiers at the scene, as onlookers shouted abuse and beat or pelted them with debris from the blast site.
The rebels and the government traded blame for the attack, which comes nine days after a shell also killed 13 people on a bus in the village of Buhas outside Volnovakha, 35km (22 miles) south-west of Donetsk.
Fighting between the army and Russian-backed separatists has intensified in and around Donetsk as well as further east in Luhansk region.
The deaths come after Ukraine, Russia, France and Germany issued a joint call to end fighting in the east.
They also agreed on a line of demarcation between separatists and government forces from which both sides are meant to withdraw their forces, but so far this has not been carried out.
The airport just outside Donetsk, which has been reduced to rubble, took on symbolic value for both separatists and the government over the winter.
Ukraine’s defence ministry said 20 Ukrainian soldiers had withdrawn from the main terminal because their positions were destroyed and they were under direct shelling.
The loss of the main terminal is a major blow to pro-Kiev forces and will send political shockwaves back to the capital, the BBC’s David Stern reports from Kiev.
The defence ministry blamed separatists for the shelling of the trolleybus, saying their own forces were 15km away. But the rebels blamed pro-government “saboteurs” in the city.
Captured Ukrainian soldiers were led to the blast site by rebels who appeared to do little to stop people hitting them.
“They have to be punished, like Saddam Hussein,” pensioner and local resident Zina told AFP news agency. “They are killers. They killed our children. Our children cry every day.”
But another pensioner, Lyuda, said she was “ashamed of what is happening”. “I have pity for them,” she said, weeping. They are victims of [Ukrainian President Petro] Poroshenko. They are not guilty, they were sent here.”
Russian Foreign Minister Sergei Lavrov blamed Ukrainian forces for what he called a “monstrous new crime” and a “coarse provocation”.
More than 4,800 people have been killed and some 1.2 million displaced since pro-Russian rebels seized parts of Luhansk and Donetsk regions in April.
The insurrection began after Russia annexed Ukraine’s Crimea peninsula in March – weeks after Ukraine’s pro-Russian President Viktor Yanukovych had been ousted.
Some 5.2 million people live in conflict-affected areas and 1.4 million are considered “highly vulnerable and in need of assistance”
More than one million people have fled their homes with 633,523 living as displaced persons within Ukraine and 593,622 living outside Ukraine, mostly in Russia
More than 4,800 people have been killed in the fighting and at least 10,322 have been injured including at least 102 children
There have been reports of fighting in recent days near the town of Slovyanoserbsk, north-west of Luhansk – an indication that violence is spreading beyond the Donetsk region.
Ukraine says Russia has more than 9,000 soldiers fighting alongside the rebels, a claim that Moscow denies.
Nato Secretary-General Jens Stoltenberg said on Wednesday there had been a recent build-up in the numbers of Russian tanks and other heavy military equipment in eastern Ukraine.
Russian Deputy Prime Minister Arkady Dvorkovich repeated Russian denials of intervention in Ukraine.
“We know that there are some Russians that fight on the side of those regions in Ukraine – some people that are coming on their own and fight,” he told the BBC.
“We’re trying to make sure that those people [in eastern Ukraine] are protected and to preserve their rights,” he said. “We need a peaceful Ukraine.”