NASHUA, N.H. – An immigrant from Brazil living in New Hampshire has won a temporary stay from a federal court to block his deportation, hours before he was ordered to board a plane.

The 1st Circuit Court of Appeals in Boston said it needed time to review the case of 65-year-old Elvecio Viana, of Nashua.

Viana’s lawyers say he came into the United States 27 years ago on a visa. He recently filed papers for permanent resident status.

He was summoned by Immigration and Customs Enforcement authorities March 5 and was taken into custody. He was told to buy airline tickets and leave within 29 days.

Viana sued to challenge his deportation and the Justice Department objected. A judge dismissed it Monday and his lawyers quickly appealed. The stay was granted Tuesday, 14 hours before Viana was due at the airport.