A New York man who spent four years on the run to avoid U.S. charges that he tried to cheat Facebook Inc. founder Mark Zuckerberg out of half the company won a surprise order from Ecuador’s president allowing him to remain in the country.

Paul Ceglia will be released from a Quito jail after President Lenin Moreno overruled his nation’s courts and denied a U.S. request that Ceglia be returned to New York. Ceglia has been locked up since he was arrested in August on the coast of the South American country.

In a two-page declaration made public Friday, Moreno cited the past failure of the U.S. to extradite accused criminals wanted in Ecuador, without naming individuals. Ecuador has been trying for years to win the extradition of two former bankers, William Isaias and his brother Roberto Isaias, who were convicted there in 2012 in their absence. The U.S. arrested them in February, then released them.

Ceglia has a one-year-old son, Orayan, who was born to Ceglia and his wife Iasia while they were on the lam. Moreno also pointed to the welfare of the child in making a decision that overruled his nation’s highest court. That court granted the U.S. extradition request in November and affirmed it in February in an appeal.

"That’s Paul Ceglia one, Facebook zero," said Roberto Calderon, a Quito lawyer who has represented Ceglia in fighting extradition to the U.S.

Dawn Dearden, a spokeswoman for U.S. Attorney Geoffrey Berman in New York, declined to comment. A Facebook representative didn’t immediately return an email seeking comment.

Ceglia sued Facebook and Zuckerberg in 2010, claiming that a contract he signed with Zuckerberg in 2003 gave him 84 per cent of the company that would grow into the world’s biggest social network. Ceglia later reduced the demand to half. Zuckerberg, who in 2003 was a freshman at Harvard University, has said he signed an unrelated contract to do website coding for Ceglia.

U.S. prosecutors charged Ceglia with wire fraud and mail fraud in 2012, saying he forged the contract, destroyed evidence and created fake emails between himself and Zuckerberg to support his claim.

Moreno’s order comes just weeks after he removed the asylum status of WikiLeaks founder Julian Assange and forced him out of Ecuador’s embassy in London, where Assange spent almost seven years. Assange, accused of 17 counts related to endangering U.S. national security, is now fighting extradition to the U.S.