Demonstrators chanted the president's initials during the amendment debate
Djibouti's parliament has approved a constitutional amendment which will allow President Ismael Omar Guelleh to run for a third term.
As well as abandoning two-term limits, MPs have shortened presidential mandates from six to five years and set 75 as the age limit for candidates.
Mr Guelleh, 62, won the 2005 poll unopposed, and said he would step down at the end of his second term.
The opposition fielded no candidate in 2005 and has no seats in parliament.
Mr Guelleh, known in Djibouti by his initials IOG, has not indicated whether he will run again for president.
He succeeded his uncle - Djibouti's first President, Hassan Gouled Aptidon - in April 1999.
The BBC's Kaltum Ali in Djibouti city says a big crowd of his supporters gathered in the capital, chanting "IOG" while the amendment had its second reading in parliament.
"We received a mountain of petitions where the people wanted the president to be able to continue with the reforms he launched, notably the fight against poverty and the development of the energy sector," Idriss Arnaoud Ali, the speaker of the National Assembly, told the AFP news agency.
Our correspondent says the amendment was passed by 59 MPs in the 63-seat parliament; four MPs were absent.
Elections are due in May next year, she says.
Mr Guelleh supports Djibouti's traditionally strong ties with France, the former colonial power.
The country is of major strategic importance in the Horn of Africa - it hosts France's largest military base in Africa and the only US base on the continent.
Its port is used by several landlocked African countries, as well as foreign navies carrying out operations against Somali pirates.