The girl, 12, had played "water poker" on the Aland Islands of Finland near Sweden, the Swedish news agency TT and The Local.se reported Friday.
The game's rules required the loser of each hand of poker to drink a glass of water.
Teachers did not realize the girl had consumed too much water until they conducted a count of students in the evening.
"She sat on the toilet and vomited. She had drunk an enormous amount of water," Jukka Silvola, principal of the school, told the Aftonbladet newspaper.
The principal said the girl was "truly well-liked."
The girl was taken to a hospital in Mariehamn, Finland, before being transferred to Uppsala University Hospital in Uppsala, Sweden, north of Stockholm.
She was declared brain dead at the hospital and taken to her hometown in Nystad in eastern Finland in May. She died there a few days later.
Johan Valtysson, head of the intensive care ward at the Uppsala hospital, said drinking too much water can dilute the blood and decrease salt levels in the blood, drawing water into the brain, which swells. The blood flow to the brain is then cut off, Valtysson said.
He said water poker is "a truly dangerous game."
Texas principal bans speaking Spanish, stirs controversy
Man behind Doritos Locos Tacos passed away on Thanksgiving