Link: https://www.kanaloco.jp/news/government/article-905621.html
横須賀市は21日、市立馬堀中学校でプールの給水栓を約2カ月間、断続的に開けたままにしたことで、約423万8千リットルの水道水が流出したと発表した。
This seems to be a AをBと construction. But parsing it like that gives "It was announced that pool's water tap (in ... school) as ...". So I wonder if this is the correct way to parse to begin with.
Also, how do we parse ままにしたことで? ままに -> while, したこと -> nominalized did, で -> then (???)?