Taiwan's President Chen Shui-bian and Vice-President Annette Lu have been shot at a rally only hours before the country goes to the polls.
The president received an 11 centimetre wound
It is not clear how many shots were fired in the southern city of Tainan but Mr Chen was hit in the stomach and Ms Lu in her right knee.
Both were treated in hospital and have since been released.
Officials said Mr Chen had urged people to stay calm and pledged that the elections would go ahead as planned.
But both the governing and opposition parties announced that they were suspending their campaigns.
It is not known who carried out the attack, or what the possible motive might be, but the island has raised its national security alert after the attack on the head of state.
Security around the opposition candidate Lien Chan has also been tightened.
The BBC's Chris Hogg in Taiwan says the president and vice-president were being driven in a red open-top car through crowds of supporters when the shots were fired.
An apparent bullet-hole was visible in the windscreen of the car at the front of a motorcade.
The streets of Tainan, the president's home town, were packed with cheering supporters and celebratory firecrackers were being set off.
'Able to walk'
"The vice-president first felt pain in her knee and she thought it was caused by firecrackers," presidential secretary general Chiou I-jen told a news conference in Taipei.
"Then the president felt some wetness on his stomach area, and
then they realised something was wrong."
News of the unprecedented attack has caused nationwide shock
The presidential motorcade then travelled at high speed to Chi Mei hospital in Tainan.
An official at the hospital said Mr Chen's motorcade had raced into the hospital compound, which was immediately closed off.
The president was conscious and able to walk into the hospital himself, a local TV reporter said.
Appeal for calm
In the ensuing confusion early media reports said that that the president had been injured by one of the firecrackers. But Mr Chiou later said "it was definitely a gun attack," adding that officials removed a bullet from the president's stomach.
Taiwanese television ran pictures apparently showing the president's stomach, grazed by the bullet.
The president is still in control of the state, officials say
Mr Chiou said that Mr Chen was still conscious and "can still direct the nation's affairs". Ms Lu is also said to be conscious.
"They did not suffer life-threatening injuries. They urge the public to cool down," Mr Chiou added.
The two leaders, who were both described as being in a stable condition, have now left the hospital. They were driven from the building in a car with blacked-out windows.
Taiwanese television reported that they were being driven to Air Force One, the presidential plane, and will be flown to Taipei, where they will each return to their respective residences.
Correspondents say it is the first attack on a president in Taiwan and the incident has caused widespread shock and grief.
Crowds have been gathering at the headquarters of the president's party in Taipei, many of them in tears, our correspondent says.
Result in the balance
Analysts have been saying that the election is too close to call, and our correspondent in Taiwan says that the shooting makes the result even more unpredictable.
Experts are saying that Mr Chen may now be propelled to a significant victory by a sudden wave of public sympathy.
Along with the presidential election, there will also be a nationwide referendum on whether Taiwan should beef up its defences against hundreds of Chinese missiles pointed at the island.
Beijing has so far issued no response to the shooting.
China sees Taiwan as a breakaway province which should be reunited with the mainland, by force if necessary.