Malawi's constitutional court has dismissed an appeal by former President Bakili Muluzi against a ban on him standing for a third term in office.
The court said allowing him to run in next week's election would have meant an end to the limit on how long a president can serve.
The ex-president's lawyer says he will appeal to the supreme court.
Mr Muluzi, who served as president between 1994 and 2004, said the ban breached his political rights.
His lawyer, Kalekeni Kaphale, said the issue was an important one and they wanted to "pursue it all the way."
But he added that they did not wish to postpone the election.
Mr Muluzi's team had argued that he was entitled to stand again as he has had a period out of office.
The decision to stop him from running for a third term was taken by the electoral commission in March.
No repeat of Banda
Representing the commission, Attorney-General Jane Ansah said the constitutional court's decision was a good one.
"It clarifies the point - it's a maximum of two five-year terms and no more," she said.
The two-term limit was introduced to prevent a repeat of the rule of veteran leader Kamuzu Banda, who declared himself president-for-life before losing power to Mr Muluzi in the first multi-party poll in 1994.
Mr Muluzi is also facing charges over the alleged theft of $12m (£8m) in aid money during his time in office. The case goes to trial later this year.
Tuesday's presidential election will see the incumbent, President Bingu wa Mutharika, of the Democratic Progressive Party, seeking a second term in office.
Standing against him is John Tembo, of the Malawi Congress Party.rdqsmzy