TOKYO —The Toyota executive who was arrested in Japan on suspicion of illegally importing prescription narcotics will not be charged after prosecutors determined her act was “not malicious,” a Japanese news agency reported.

American Julie Hamp, who resigned her job as chief global communications officer for Toyota following the incident, will be released after spending three weeks in jail, Kyodo News reported.

“The prosecutors appeared to have taken into consideration the fact that the 55-year-old American’s act was not malicious and that she has already resigned from the post at the Japanese automaker,” the news outlet reported on its English-language website, citing “investigative sources.”

She is expected to be released from jail Wednesday, when a 20-day detention period is to expire. Depending on the charges, she could have faced up to 10 years in prison.

The development would come after Toyota publicly defended Hamp, saying it believed she did not knowingly break any laws. The company’s president, Akio Toyoda, even held a televised news conference to declare Hamp a “friend” and an “invaluable” part of the automaker.

But Hamp, who has remained in custody since her arrest June 18, nonetheless relinquished her job at the world’s largest automaker, where she had become the top ranking female executive.

Toyota officials said in a statement that Hamp had tendered her resignation on June 30, while still in jail. The resignation was accepted “after considering the concerns and inconvenience that recent events have caused our stakeholders,” the company said.

Her hiring was billed as a key step in the diversification of Toyota’s executive ranks, which have remained mostly Japanese even as the auto industry has become globalized.

Authorities had accused her of shipping 57 pills of oxycodone to herself. Japan strictly regulates narcotics, making it a serious offense to import prescriptions without the government’s permission.

Hamp has not issued a public statement since her arrest.

Under Japan’s tough criminal justice system, suspects can be held up 20 days without bail or formal charges after being referred to prosecutors by police.

Hamp’s arrest has been embarrassment for Toyota, one of the most prestigious companies in Japan. Police raided company headquarters and offices in Tokyo and Nagoya on June 23.

The company’s president, Toyoda, went on national television shortly after Hamp’s arrest to voice support for her. He apologized for “the confusion surrounding recent events” but said he believed that she had not knowingly broken Japanese law.

Oxycodone is a widely prescribed painkiller in the United States. But possession is illegal in Japan without a prescription and special permission is required to bring it into the country.

Spitzer reported from Japan and Bomey reported from McLean, Va.

Follow USA TODAY reporter Nathan Bomey on Twitter @NathanBomey.