When her body was discovered near her villa, her relatives were shattered.

Ms. Jaime, her best friend, said the local authorities should have done more to publicize the risks to women in the country. “They have a responsibility to tell tourists of all the risks, and they are not doing it,” she said.

Ms. Stefaniak was the third foreign woman killed in Costa Rica in three months. But the country was also grappling with a deeper, more systemic problem of brutality against local women, ones who did not have the power of an American passport to help galvanize agencies like the State Department or the F.B.I. on their behalf.

At least 14 women were killed in gender-based violence in the country from January to August 2018. In September, the government declared violence against women a national problem.

The National Institute for Women, a government ministry, pointed to the murders of foreigners last summer in a statement to illustrate the issue: “We are faced with the fact that, beyond the damage it may cause to the image of the country, they are clear examples of the serious situation of violence against women, which has its most brutal expression in femicide.”

Still, Costa Rica is considered one of the safest countries in Central America, particularly for tourists, with a lower homicide rate than many neighboring nations. Officials say they have made strides to combat gender-based violence.

Ms. Jaime said she believed that her friend might have been targeted because she was a Spanish speaker who blended right in and her killer might have thought the police would be lax. “Maybe because she spoke Spanish, he might have felt no one would have looked for her,” Ms. Jaime said.

But she said the attacker had underestimated the determination of Ms. Stefaniak’s family. Not only are her relatives fighting for justice in Costa Rica’s courts, they also filed a lawsuit accusing Airbnb of negligence. Their lawyer in Costa Rica, Joseph Alfonso Rivera Cheves, appeared to suggest a callous disregard in the aftermath, noting that the same day Ms. Stefaniak vanished, her Airbnb room was being cleaned and new renters checked in.