(AP Photo/Dita Alangkara)
President Maumoon Gayoom was unhurt, but his shirt was ripped as the attacker tried a second time to stab him before being overpowered by security guards, government spokesman Mohammed Shareef said.
"One brave boy saved the president's life," he said.
Mohammed Jaisham Ibrahim, wearing his blue Maldives Scout uniform with a blue kerchief, was standing in the crowd to greet Gayoom on Hoarafushi, one of the 1,190 coral islands in the Indian Ocean that make up the Maldives.
The attacker hid a knife in the Maldivian flag as he awaited Gayoom's arrival, then lunged at the president, Shareef said.
Ibrahim reached out and grabbed the blade, and he was cut on the hand, according to the government.
"There was blood on the president's shirt, but it was not his but the boy's," Shareef said.
"His wound was stitched, but later he complained that he could not move some of his fingers," Shareef said, adding the youngster was flown to the Maldives' capital, Male, for treatment.
Boy Scouts in the Maldives are similar to their U.S. counterparts, receiving training in first aid and participating in activities like camping. Their motto is the same as well: "Be Prepared."
After the attack, Gayoom addressed the nation in a radio broadcast, thanking the teenager and calling for calm, according to the Web site of the Minivan newspaper.
"We should not resort to violence even if we have differences between the parties," Gayoom was quoted as saying.
A police Web site identified the attacker as Mohamed Murshid, 20. No motive was given, and other details were not disclosed.
Shareef, speaking by telephone from Male, said the assassination attempt may have had a "political motive," but it was too early to say if Islamic militants were involved. Opposition to Gayoom's three-decade rule has grown in recent years and there have also been concerns about increased Islamic militancy in the Muslim nation.
Gayoom, 70, has ruled the Maldives since 1978 and helped turn it into a major destination for tourists seeking a quiet vacation on virgin beaches surrounded by crystal blue waters.
However, the country of 350,000 people has also had its share of turmoil in recent months.
On Sept. 29, a bomb blamed on Islamic militants exploded in a park in Male, wounding 12 tourists. A week later, police and soldiers raided an island that was a reputed insurgent stronghold, sparking a battle with masked men armed with clubs and fishing spears that wounded more than 30 security officers.
In recent years, Gayoom has also faced opposition protests of his previously unchallenged rule. Under pressure, he legalized opposition parties and agreed to hold the nation's first truly democratic election later this year.
The New Maldives Movement, a new opposition coalition formed to challenge Gayoom's rule in upcoming elections, condemned the attempted assassination.
"The NMM calls for an independent and speedy investigation into the attack and stresses the importance of making the results of the investigation public," the group said.