An American environmental journalist was deported from Indonesia Friday, after being detained for more than six weeks on suspicions he violated the conditions of his visa.

Philip Jacobson, 31, an editor for the U.S.-based environmental science website Mongabay was traveling in Palangkaraya, the capital of Central Kalimantan province on the island of Borneo, when he was detained by Indonesian immigration authorities on Dec. 17. He faced up to five years in prison on charges of violating the 2011 immigration law.

The case appeared to center on Jacobson’s use of a business visa rather than a journalist visa, according to his lawyer, Aryo Nugroho, the head of Indonesian Legal Aid. But his detention prompted an outpouring of criticism from rights activists, who saw it as indicative of a broader clampdown on Indonesia’s press freedom.

Upon his release, Jacobson told Mongabay he was both relieved and saddened.

“It’s good to be out of prison and I’m relieved the prospect of a five-year jail sentence is no longer something I have to contemplate,” he said.

“At the same time, I am deeply saddened to be deported from the country. Indonesia is a magnificent country with a big heart, full of some of the funniest and most generous people on Earth. I am fortunate to have made some of my dearest friendships with people from around the archipelago.”

He vowed to return, after applying for a journalist visa.

“I look forward to returning to Indonesia at the earliest opportunity,” he said.

Prior to the Friday night deportation, Jacobson’s father told TIME of his son’s love for Southeast Asia. “He has traveled the entire region, and deeply integrated himself in Indonesia,” says Randy Jacobson, who lives in Chicago. “He speaks fluent Bahasa Indonesia, has many Indonesian friends, and has a true affinity for Indonesian culture.”

Jacobson’s prolonged detention sparked calls for Indonesia to improve its press freedom. While the government had pledged to ease its opaque visa restrictions for foreign journalists after President Joko Widodo (commonly known as “Jokowi”) took office in 2014, critics say he has failed to keep his promise. Instead, his presidency has been marked by serious press freedom violations, especially restrictions on media access to West Papua, which was gripped by unrest in 2019.

Last year, Indonesia ranked 124 out of 180 countries on Reporters Without Borders’ annual World Press Freedom Index.

“[Reporters Without Borders] is deeply relieved to learn that Phil Jacobson is not behind bars anymore, but it is unacceptable that he is forced into deportation while possessing a proper visa,” Daniel Bastard, the head of RSF’s Asia-Pacific desk, tells TIME.

“At this time, it is crucial that president Jokowi’s government show more commitment towards press freedom, especially in letting Indonesian and foreign journalists report freely and without fear of reprisal,” Bastard says.

He added that the process of obtaining a journalist visa “must not be arbitrary as it is now.”

Andreas Harsono, Indonesia researcher at Human Rights Watch, tells TIME that applications for journalist visas can get mired in red tape, sometimes without ever obtaining approval.

“Some sensitive subjects include Papua, religious freedom, environment sustainability and LGBT rights,” Harsono says.

Jacobson’s arrest came after he attended a public meeting between lawmakers and a local chapter of Indonesia’s largest indigenous rights group in December. While he had covered corporate malfeasance, deforestation and scrutinized Jokowi’s track record on environmental issues for Mongabay, his lawyer said the case did not appear to be motivated by any particular article. While some activists speculated that his detainment may have been related to his environmental work, Jacobson’s colleagues said he was in the country at the time for meetings, not reporting.

While Jacobson was in jail, he and a colleague were awarded second prize for excellence in environmental journalism at Switzerland’s Fetisov Journalism Awards for an investigation into a paper producer’s ties to deforestation in Borneo (a claim the company denied).

“We’re very proud of him for doing work that helps to shine a light on some of the planet’s most pressing environmental issues,” Randy Jacobson told TIME.

Jacobson is not the first foreign journalist to have been recently jailed over administrative issues in Indonesia. In 2014, two French journalists spent two and a half months in jail for filming a documentary in West Papua while on tourist visas. The following year, two British journalists were handed a similar sentence for making a film while on tourist visas. Others have been deported for allegedly failing to obtain journalist visas.

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Amy Gunia at amy.gunia@time.com.