BEIJING—A student at an elite Chinese university accused the school of trying to muzzle her #MeToo activism in a surprising open letter that set off a scramble by the country’s censors.

In the letter, which began circulating online Monday, Yue Xin said she joined other Peking University students in submitting an open-records request about a 20-year-old rape allegation involving a then-professor. The school rejected the request last Friday, the letter said, and two days later a university official burst into her room late at night with her mother.

They forced her to delete materials related to the case from her phone and laptop, the letter said, and the following morning Ms. Yue was told to sign a statement swearing off further involvement before being taken home by her mother. “I’m afraid and furious. Applying for open information constitutes what kind of crime?” Ms. Yue said in the letter.

In a statement posted online, the university disputed Ms. Yue’s account. It said her adviser contacted her mother after failing to reach the student on the phone and that she left campus to avoid disturbing other students. It didn’t address other allegations by Ms. Yue, such as the forced statement. The university didn’t respond to a request for comment. Ms. Yue and her family couldn’t be reached for comment.

Ms. Yue’s letter ricocheted around Chinese social media and went viral among the university’s large and influential alumni, with users battling censors to keep it online. Searches for Ms. Yue’s name were blocked on the Twitter -like Weibo microblogging platform. Several local media reports about her campaign were taken down on Tuesday.