BANGOR, Maine — Montreal Maine & Atlantic Railway has agreed to a $30,000 fine to settle a claim by the Environmental Protection Agency that the company violated the Clean Water Act and federal regulations during a 2009 oil spill.

The EPA, in a Thursday news release, said a railway employee left a fuel transfer unattended at the company’s repair and maintenance shop in Milo on Oct. 2, 2009, and that oil traveled underground and into the Piscataquis River. The company has a total storage capacity of nearly 108,000 gallons of oil at its facility.

Robert Grindrod, the railroad’s president and chief executive officer, had no immediate comment when reached by telephone Thursday.

Railroad officials discovered the oil overflow the evening of Oct. 2, and on Oct. 3 alerted the Maine Department of Environmental Protection, the National Response Center and EPA, according to David Deegan of the EPA. He said the oil spill caused a noticeable but temporary sheen on the Piscataquis River. An oil spill response company hired by the railroad worked with the DEP to contain and clean up the spill. The railroad subsequently worked with EPA to come into compliance with spill prevention regulations, he said.