A pro-rebel website, TamilNet, said the Liberation Tigers of Tamil Eelam (LTTE) had claimed what it described as "successful air raids".
They involved "diving into Sri Lanka Air Force (SLAF) Headquarters in Colombo and into the SLAF base at Katunayaka", 35km (21 miles) north of the capital, the website said.
TamilNet named the two pilots as Col Roopan and Lt Col Siriththiran - describing them as decorated pilots from the "Black Air Tigers" squad - and showed a picture purportedly of the men with Tamil leader Velupillai Prabhakaran.
Correspondents say the attack amounts to a major embarrassment for Sri Lanka's government, which had claimed to have destroyed all the rebels' hidden runways and put its small air force out of action.
The city was put on full alert at about 2130 (1600 GMT) on Friday as electricity was cut and searchlights and tracer fire from anti-aircraft guns cut through the night sky.
One of the aircraft crashed in marshland near an airport
Briton Barry Walker told the BBC that he was in a central Colombo hotel when the blackout hit.
"We were sitting by the swimming pool when we heard firing of heavy anti-aircraft guns. Heavy shell fire. This lasted 20-25 minutes... then there was a massive explosion," he said.
Mr Walker and other guests were ushered into the hotel's basement for about two hours until the all-clear was given.
Another witness told the BBC he saw a low-flying aircraft and then heard a huge explosion by the city's fort, where many government offices are located.
The air force headquarters, which is in the same area, may have been the target, correspondents say.
The ministry of defence said a tax office of the inland revenue department was in flames after one of the planes went down into the building.
Most of the windows in the high-rise office block were blown out and several floors were gutted by fire.
The other plane was shot down next to the international airport, just outside Colombo, and the body of its pilot had been found, defence spokesman Keheliya Rambukwella said.
Witnesses at the airport told Associated Press news agency that anti-aircraft guns had been firing followed by an explosion.
Military spokesman Brig Udaya Nanayakkara said the alert began when a suspected Tamil Tiger aircraft was spotted north-east of Colombo and the capital's air defences were activated.
Air force jets were scrambled to engage the planes.
Tamil leader Velupillai Prabhakaran, centre, was pictured with the two pilots
The attack comes as a major Sri Lankan army offensive has inflicted a series of defeats on the Tamil Tiger forces, pushing the rebels into a narrow area of jungle in the north of Sri Lanka.
The Tigers have used light planes in the past to attack Colombo and military targets in other areas of Sri Lanka.
The Tigers were believed to have a number of two-seater Czech-made Zlin-143 aircraft fitted with homemade bombing equipment.
The propeller-driven planes were reportedly smuggled into the country in pieces before being reassembled and modified to carry bombs.
About 70,000 people have died in the last 25 years as the Tigers have been fighting for a separate homeland in the north and east of the country.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.