Police in the Philippines have shot and killed a former police officer who was holding 15 tourists hostage on a bus in Manila.
Eight hostages from Hong Kong have been confirmed dead.
The gunman, identified as former police captain Rolando Mendoza, was armed with an M-16 assault rifle.
He had stopped the bus, which initially had 25 people on board, across a wide road in Manila's biggest park.
The 55-year-old said he had shot two of his captives and would kill the others if police did not meet his demands.
For much of the day, the gunman had appeared to be negotiating calmly with police. Nine hostages, six from Hong Kong and three from the Philippines, had been released in stages.
Mr Mendoza had asked for food for those remaining on the bus, which was delivered, and fuel to keep the air-conditioning going during the heat.
A handwritten note stuck to the bus door had warned that a 'big deal' would happen after 3pm (8am Irish time), but the deadline passed without incident.
One hostage was released after that deadline and negotiations continued as the stand-off stretched to over 12 hours.
The end of the drama came more than an hour after police officers had moved in to break windows and surround the bus following a series of shots.
The driver of the bus was seen running to safety after the first flurry of gunshots.
Shortly after, there was a burst of automatic gunfire from within the bus. The body of the man believed to be the gunman was later seen slumped out of the main door of the vehicle.
It is understood he had sustained a gunshot wound to the head.
'The hostage-taker was killed. He chose to shoot it out with our men,' police Colonel Nelson Yabut told reporters.
'On our first assault, Captain Mendoza was sprawled in the middle of the aisle and shot one of our operatives. On our second assault we killed him.'
Mr Mendoza's brother, Gregorio, told a local TV station that his brother was upset by his dismissal from the force.
Local media said he had been sacked for reasons, including extortion, and he had lost his retirement benefits due to his sacking.
'His problem was he was unjustly removed from service. There was no due process, no hearing, no complaint,' said Gregorio Mendoza, who was later taken into custody by police.
Stuck to the bus door was a piece of paper with the handwritten message: 'Big mistake to correct a big wrong decision'.
A larger piece of paper on the front windshield was headed 'Release final decision' and then what appeared to be details of his case.
Hong Kong's leader Donald Tsang has criticised the handling of the hostage crisis.
Mr Tsang said: 'It is most regrettable. The way it was handled, particularly the outcome, I find is disappointing.'