TOKYO — When Carlos Ghosn, the flamboyant auto executive, posted a record $14 million bail in the spring, he agreed to have surveillance cameras installed outside his Tokyo home, he was denied access to the Internet, and, for months, he was even banned from talking to his wife.

But on Tuesday, the charismatic and controversial former boss of the Nissan-Renault car alliance had fled Japan, where he was awaiting trial on charges of financial misconduct, and arrived in Lebanon after a secretive departure that left Japanese authorities and his attorneys mystified, embarrassed and angry.

Ghosn, who is of Lebanese descent and holds Lebanese, French and Brazilian citizenship, did not say how he had managed to abscond, just months before his trial was due to start.

One of his Japanese lawyers insisted they still had possession of his three passports, as required by the terms of his bail, and expressed bafflement and embarrassment. Lebanese authorities said he had entered the country legally carrying his French passport and Lebanese ID card.

“I am now in Lebanon and will no longer be held hostage by a rigged Japanese justice system where guilt is presumed, discrimination is rampant, and basic human rights are denied, in flagrant disregard of Japan’s legal obligations under international law and treaties it is bound to uphold,” Ghosn said in a statement.

Japanese media reports spoke of “shock” about the escape, embarrassment for the country and its security system, anger at Ghosn and his lawyers, and vindication for prosecutors who had vehemently opposed granting the executive bail for precisely this reason.

Former Tokyo governor Yoichi Masuzoe, an outspoken critic of the current administration, said the escape underlined the international isolation of Japan’s legal system and its inability to gather information, contrasting it with Ghosn’s many international connections.

“Japan is a pathetic small country deficient (or lacking) in information, at the mercy of Ghosn alone,” he wrote on Twitter.

Masahisa Sato, a ruling-party member of Japan’s upper house and a former defense forces officer and deputy foreign minister, asked whether Ghosn had the support of another country.

“Japan’s sovereignty has been infringed and its legal system has been challenged,” he wrote on Twitter. “It’s a major problem that Japan easily allowed his illegal departure.”

Under the terms of his bail, Ghosn needed court permission to go on a trip of more than two nights, was banned from using email and could only use a personal computer at his lawyer’s office that was not connected to the Internet. Junichiro Hironaka said that he had met his client on Christmas Day but that he had given no hint of his intentions.

“It was like a bolt from the blue. We are surprised and puzzled,” Hironaka told reporters, in remarks carried by state broadcaster NHK. He added that he still believes his client to be innocent but called Ghosn’s escape “inexcusable.”

A Lebanese security official told NHK that a person resembling Ghosn had entered Lebanon under a different name, arriving by private jet. But Salim Jreissati, Lebanon’s state minister for presidential affairs, told the An-Nahar newspaper that Ghosn had entered Lebanon legally through the airport with his French passport and his Lebanese ID.

Japan’s immigration authorities told local media that they had no record of Ghosn leaving the country. A spokesperson for Ghosn’s family declined to comment, as did a Nissan North America spokesperson.

Ghosn’s treatment since his arrest in November 2018 has thrown an unflattering spotlight on Japan’s justice system and prompted concerns in boardrooms around the world. Sympathy was high among the general public in Lebanon, and its government had complained publicly about Ghosn’s humiliating treatment behind bars.

Ghosn, one of the world’s most successful auto executives, was accused of financial misconduct and aggravated breach of trust, including by underreporting his income and enriching himself through payments to dealerships in the Middle East.

His initial 23-day detention was extended to 108 days as prosecutors rearrested him several times while he was behind bars, a common tactic used in Japan to extract confessions and widely criticized as amounting to “hostage justice.”

He was released in March on $9 million bail, then rearrested in April just after announcing plans to hold a news conference, before finally being granted a second bail for an additional $5 million under strict conditions, including that he not speak to his wife.

With conviction rates around 99 percent in Japan, and Ghosn facing a maximum sentence of 15 years in prison, he clearly felt that the odds were against him.

“Maybe he thought he won’t get a fair trial,” Hironaka said. “I can’t blame him for thinking that way.”

Competing theories swirled online. At first, some speculated that Japan’s Foreign Ministry might have agreed to a Lebanese request to allow Ghosn to leave. But Lebanese authorities said they had no advance warning from Japan about the executive’s arrival, and subterfuge seems more likely. Ghosn had a track record: He had disguised himself as a maintenance worker when he left jail on bail earlier in 2019 in an unsuccessful bid to evade media attention.

The most colorful theory was offered by the Lebanese MTV news channel, which reported that Ghosn had been smuggled out of his residence in a storage container designed for musical instruments, after a band played at his residence, and taken to Osaka’s Kansai airport, where he left on a private jet. But the report was unsubstantiated.

Japanese flight records show a private aircraft departing Kansai airport for Turkey on Sunday night, according to local media.

Japanese prosecutors had opposed granting Ghosn bail and told Japanese media that they feared he might try to escape. Lebanon does not have an extradition treaty with Japan, and it is unlikely that any attempt to extradite him would be successful.

Hironaka said that his client must have had the help of a “large organization” to have fled. French newspaper Le Monde reported Tuesday that the escape was planned by Ghosn’s wife, Carole, who was on his plane when it arrived in Beirut.

Writing in The Washington Post in April, Carole Ghosn proclaimed her husband’s innocence and complained of his treatment behind bars, saying he had been kept in solitary confinement, with the lights on around the clock, and subjected to interrogations at all hours of the night and day without access to his attorneys.

The case prompted questions about whether a Japanese executive would have faced the same treatment and why Ghosn and U.S. citizen Greg Kelly were the only Nissan board members arrested, when the company’s Japanese executives should also have known about Ghosn’s compensation arrangements. Kelly remains in Japan awaiting trial.

Japan’s security regulators recently fined Nissan $22 million over inaccurate financial disclosures, and Ghosn’s successor, Hiroto Saikawa, resigned in September over allegations of financial misconduct but has not been charged with a crime. Meanwhile, sales and profits at the auto giant have crumbled.

Ghosn and his attorneys say the allegations were trumped up as part of a conspiracy among Nissan, government officials and prosecutors to oust Ghosn and block his plans to force through a closer merger between the Japanese automaker and its alliance partner, Renault. Ghosn spoke out about “backstabbing” by his former colleagues.

Concerns also have been raised about Ghosn’s management.

In dismissing Ghosn in 2018, Nissan said its investigations revealed misconduct that included understating his salary and transferring $5 million of company funds to an account in which he had an interest.

Renault, initially supportive of its former boss, announced in April after an internal investigation that it had found evidence of “questionable and concealed practices and violations of the group’s ethical principles.” At the time, Renault said it would halt Ghosn’s pension and reserved the right to bring action against him in the courts.

Ghosn earned a reputation as one of the auto industry’s top executives after turning around the fortunes of Renault and Nissan and bringing the two companies together in a three-way alliance with Mitsubishi.

But his efforts to forge closer links between Renault and Nissan ran into opposition from within the Japanese company, and many experts say that may have been a factor in his downfall.

His reputation for streamlining Renault’s operations won him the nickname “Le Cost Killer,” while his success in turning Nissan around from near bankruptcy earned him the moniker “Mr. Fix It.” His efforts made him popular in Japan, with blanket media coverage and even a manga comic produced about his life. However, his lavish lifestyle and relatively high pay remained sources of controversy.

Rachel Siegel in Washington and Akiko Kashiwagi contributed to this report.