ST. PETERSBURG—The detention of a prominent Russian journalist known for investigating corruption has rattled the media community in the country and highlights the pressure faced by news outlets fighting to preserve their independence.

Ivan Golunov, 36, a reporter for the Latvia-based independent news website Meduza was detained Thursday for alleged drug offenses, according to information published by the Moscow police. On Saturday, a Moscow court placed Mr. Golunov under house arrest for two months after he was charged with...