Investigators said Friday that the 7-year-old girl who died from carbon monoxide poisoning on a Lake Minnetonka boat earlier this week had been resting in the boat’s cabin where there was a hole in the exhaust pipe.

The Hennepin County Sheriff’s Office said Friday that the hole was underneath the mattress area in the lower cabin area and was likely caused by animals chewing through the pipe. Sophia Baechler, 7, of Edina had gone below deck to rest because she wasn’t feeling well, the Sheriff’s Office said, and was found “in distress” about 10 minutes later.

Wayzata police responded to the family’s boat as it docked into Wayzata Bay on Sunday and found the boat occupants giving the girl CPR. She died at Hennepin County Medical Center in Minneapolis.

The Hennepin County medical examiner confirmed Wednesday that Baechler died of carbon monoxide poisoning and ruled the death an accident.

Baechler was a second-grader at Edina’s Concord Elementary School. Her funeral was held Friday. A fund set up in her name has raised more than $31,000 so far for Camp Kici Yapi and Concord Elementary.

Sophia, who would have turned 8 in December, loved playing with her friends, being with family, playing soccer, drawing, singing and dancing, her family said Wednesday in an obituary. She’s survived by her parents, Benjamin and Courtney Baechler, and 5-year-old brother, Will.

Carbon monoxide poisoning fatalities from a boat are fairly rare in Minnesota, and have happened twice in the last eight years, according to state data. The toxic, odorless gas can build up on a boat from an idling motor, a generator or from a faulty motor exhaust system. It’s unclear if the boat had a carbon monoxide detector, though many newer boats have them; they aren’t required in boats.

At the Minnetonka Power Squadron, which provides safe boating classes for the public, Steve Leighton said animals, especially muskrats, often crawl into exhaust pipes and other boat parts before winter. “It’s a real pain,” he said, adding that some boaters will put screens over pipes, but there is little else to prevent it.