Under a deal ending the Honduras political crisis, the ousted president leaves the country hours after Porfirio Lobo is sworn in to office.

Reporting from Mexico City and San Salvador — As a new Honduran president took office Wednesday, former leader Manuel Zelaya flew into exile in the Dominican Republic under a deal that ends months of turmoil since his ouster by the military last summer.

Zelaya, accompanied by his wife, two children and President Leonel Fernandez of the Dominican Republic, left Honduras just hours after Porfirio Lobo was sworn in as president.

Under an arrangement brokered last week by Fernandez, Zelaya agreed to abandon the Brazilian Embassy in Tegucigalpa, the Honduran capital, where he had holed up in September, and to leave the country once his term officially ended.

"We'll be back," Zelaya shouted before boarding the plane.

Lobo, a conservative rancher elected in November, escorted Zelaya to the airport in a long caravan, Honduran television reported. Hundreds of flag-waving Zelaya supporters were at the airport for the send-off, but there were no disturbances.

Lobo said his government would work for reconciliation at home, and he reached out to the many nations that had condemned Zelaya's ouster.

"We leave the past behind now and look toward the future," Lobo said after being sworn in. "But you cannot advance to the future without healing the wounds of the past."

Zelaya's departure and Lobo's inauguration allow Honduras to try to move past a crisis that laid bare deep political polarization and saw the first military coup in Central America in more than a decade.

Lobo's first act as president was to sign a decree granting political amnesty for Zelaya and the military. The measure, approved a day earlier by the Honduran Congress, does not cover embezzlement charges that the former president may face.

In addition, the Supreme Court exonerated six top officers, including the military chief of staff, ruling that they did not act with malice when they seized Zelaya on June 28 and flew him to Costa Rica. Zelaya later sneaked back into Honduras in a bid to reclaim his office.

The Supreme Court had ordered Zelaya's arrest for abuse of power, treason and other charges after he refused to drop plans for a referendum that had been ruled illegal and that foes said was aimed at helping him stay in power beyond the one-term limit.

Coup supporters refused to reinstate Zelaya despite international outrage. The United States cut off some aid and yanked the visas of some officials working in the interim government, led by Roberto Micheletti.

But pressure waned even before Lobo won the election, which was scheduled long before the overthrow. There were signs Wednesday that the world would soon normalize relations with the government.

The leftist president of El Salvador, Mauricio Funes, did not attend the inauguration but has said he would restore diplomatic ties once Lobo took office.

Lobo said Tuesday that he expected the United States to soon restore millions of dollars in non-humanitarian aid. A senior State Department official said that though the U.S. government views the first moves of the new Honduran government as positive, no decision has been made on aid.

Zelaya, a wealthy timber man, became a hero to the poor but a pariah to the country's ultraconservative elite when he shifted to the left once in office. He appears to have little chance of making a political comeback in Honduras.

According to some recent news reports, Zelaya plans to resettle in Mexico.