Martin Mendez's ordeal began when he wrote a story about Mexican police officers arresting a man who was injured in an accident.

The headline of the article, published in February 2016 in the Novedades Acapulco newspaper, reads: “Gendarmes, abusan y violan los derechos de los ciudadanos” (Security forces abuse and violate the rights of citizens).

About a month later, several men showed up at Mendez's home in Acapulco in Mexico's southern state of Guerrero. They assaulted and threatened to kill him. For months he was harassed, pursued and forced into hiding. Mexican federal officers also often called his personal phone.

The series of events described by Mendez's attorney, Carlos Spector, happened the same year that a record number of 11 journalists were killed because of their work, according to Reporters Without Borders, which considers Mexico the deadliest country for the media in the Western Hemisphere.

Mendez decided that seeking asylum in the United States was his only option. In February he crossed the border to El Paso, where his attorney turned him over to U.S. immigration officials. They took him into custody, and he has been locked up since then.

Spector said Mendez, a 26-year-old with no criminal record and who is not a threat to public safety, does not belong in jail.

“He made a lawful entry seeking asylum,” Spector told The Washington Post. “It's sending a message to asylum seekers that you will be locked up by coming to the country legally.”

In March, Spector said Mendez passed what is called a “credible fear screening,” which U.S. authorities use to determine whether an asylum seeker's life is really in danger. But U.S. Immigration and Customs Enforcement, or ICE, has declined to release Mendez. Officials say he was unable to prove that he isn't a flight risk and has substantial ties in the community.

Spector said Mendez has a cousin in Southern California, a U.S. citizen who has agreed to take him in.

Human rights groups have rallied behind Mendez, urging officials to release him and allow him to live in the United States as an asylum seeker.

“This journalist, who has been persecuted and threatened with death in his country, must be allowed to present his case for political asylum freely and with dignity before an immigration judge,” said Emmanuel Colombie, head of Reporters Without Borders' Latin America bureau.

Spector said it could take two to three months before Mendez gets an initial hearing in front of an immigration judge.

The asylum process is a lengthy one, which means that Mendez could be in jail for years, said Alan Dicker of Hope Border Institute, a New Mexico-based organization.

“If a judge decides that he doesn't get asylum and he has to appeal, he still has to remain in jail for that whole process,” Dicker told Courthouse News Service.

Leticia Zamarripa, an ICE spokeswoman in El Paso, said Mendez arrived Feb. 5 at the Paso Del Norte Port of Entry, where he was transferred to ICE's custody. He was later detained at the El Paso Processing Center.

An ICE official said decisions on whether asylum seekers should be released are made on a case-by-case basis. Each asylum application is reviewed thoroughly, the official said.

Spector said his client's incarceration is emblematic of a broader problem with how people who leave their home countries because of fear of persecution are treated after they arrive in the United States.

“What's happened to him has happened to others,” Spector said. “It's now become normal to lock people up like criminals if you're fleeing persecution, which is a violation of international and U.S. law. … What the case symbolizes is the criminalization of the asylum process.”

A new report by the Hope Border Institute and the Borderland Immigration Council found that asylum seekers were often arbitrarily detained after they arrived — even if they've fulfilled certain requirements, such as showing family and community ties. The report, titled “Discretion to Deny,” documented stories of several asylum seekers who were either turned away, detained or separated from their minor children.

One example is a Guatemalan woman who sought asylum because of domestic violence abuse and came to a port of entry in El Paso in August 2016 with her 5-year-old daughter. According to the report, the woman passed a screening, but she was detained for months while her daughter was placed in foster care.

Stories of asylum seekers being turned away also have raised concerns among advocates.

The Post's Joshua Partlow wrote in January:

At the U.S. border crossing between Tijuana and San Diego, numerous asylum seekers from Central America and Mexico have been referred to Mexican authorities for an appointment with U.S. officials — but Mexican authorities often turn them down, according to migrants and immigration lawyers. In other places, migrants have been told by U.S. border agents that the daily quota for asylum cases has been reached or that a visa is required for asylum seekers, a statement that runs contrary to law, immigration advocates say.

Michael Friel, a spokesman for U.S. Customs and Border Protection, told The Post in January that policies have not changed with regard to asylum procedures, which are based on international law meant to protect some of the most vulnerable and persecuted people.

Thirty-five reporters have been killed in Mexico since 2010, according to Reporters Without Borders. The organization ranks Mexico No. 149 in its World Press Freedom Index, which lists 180 countries.

Last month Cecilio Pineda, a freelance reporter from Mendez's home state, was killed by two gunmen on a motorcycle.

Most recently, Miroslava Breach Velducea, a reporter and editor for the Norte newspaper in the Mexican border city of Juarez, was shot eight times outside her home while she was in her car with one of her children, The Post's Samantha Schmidt reported. The phrase “being a tattletale,” was found on a rolled-up piece of cardboard.

Soon after her killing, the owner of Norte decided to end publication.

Max Bearak contributed to this story.