Pedro Pablo Kuczynski greets palace staff members after resignation, at the Government Palace in Lima, Peru March 22, 2018. REUTERS/Mariana Bazo

LIMA (Reuters) - A Peruvian judge on Saturday imposed travel restrictions on former President Pedro Pablo Kuczynski, who resigned this week while facing near-certain impeachment over ties to a construction firm at the heart of a graft investigation.

The order by Judge Juan Carlos Sanchez bans Kuczynski from leaving Peru for 18 months while his links to Odebrecht, a Brazilian construction company that has acknowledged bribing officials across Latin America, are investigated.

“The legal argument is well founded to impede Citizen Pedro Pablo Kuczynski from exiting the country,” the order said.

The ex-president’s lawyer, Cesar Nakazaki, said Kuczynski would abide by the order and cooperate with the investigation.

State security agents, meanwhile, searched two houses belonging to Kuczynski, a former Wall Street banker.

Kuczynski, who denies wrongdoing, resigned on Wednesday. Two days later his vice president, Martin Vizcarra, was sworn in as Peru’s new leader, promising to fight corruption “at any cost.”

Vizcarra said he would form a completely new cabinet and asked for lawmakers to help him restore the public’s trust in institutions damaged by the political crisis.

(Refiles to fix typo in headline)