More than 20,000 barrels of crude oil have spewed out of a Tesoro oil pipeline in a wheat field in northwestern North Dakota, the state health department said Thursday.

State environmental geologist Kris Roberts said the 20,600-barrel spill, among the largest recorded in the state, was discovered on 29 September by a farmer harvesting wheat about nine miles south of Tioga.

"The farmer was harvesting his wheat and started smelling oil," Roberts said. "It went from there."

The spill has been contained and no water sources have been contaminated, Roberts said. Cleanup crews have recovered about 1,285 barrels of oil, officials said. A barrel is 42 gallons.

Tesoro Logistics, a subsidiary of the San Antonio, Texas-based company that owns and operates parts of Tesoro's oil infrastructure, said in a statement that the affected portion of the pipeline has been shut down.

"There have been no injuries or known impacts to water, wildlife or the surrounding environment as a result of this incident," it read. Tesoro said the cause of the spill is being investigated.

"Protection and care of the environment are fundamental to our core values, and we deeply regret any impact to the landowner," Tesoro CEO Greg Goff said in a statement. "We will continue to work tirelessly to fully remediate the release area."

allegedThe hole in the pipeline was a quarter-inch in diameter, said Eric Haugstad, Tesoro's director of contingency planning and emergency response.

Tesoro officials were investigating what caused the hole in the 20-year-old, six-inch-diameter steel underground pipeline line that runs about 35 miles from Tioga to a rail facility outside of Columbus, near the Canadian border. Roberts said the hole may have been caused by corrosion.

The spill is spread out over 7.3 acres, or about the size of seven football fields, he said, noting an oil pipeline breach in the late 1980s in the northeast corner of the state was larger.

Roberts said the farmer who discovered the leak had harvested most of his wheat prior to the spill. The wheat is being tested for contamination at a local grain elevator, he said.

Tesoro owns North Dakota's only oil refinery, which occupies about one and a half square miles of land overlooking the Missouri River in Mandan. The facility was built in 1954, three years after drillers began pumping oil in North Dakota. Tesoro acquired the refinery from BP in 2001.

Tesoro said that the cleanup cost is estimated at $4m, and Roberts said state and federal regulators are monitoring the cleanup, the completion of which is not known.

Crews initially burned oil from the surface but have since dug ditches and recovery wells, Roberts said. Several vacuum trucks have sucked oil from the ditches and wells on the site, he said.

A natural layer of clay more than 40 feet thick underlies the spill site and has "held the oil up" so that it does not spread to underground water sources, Roberts said. The nearest home is about a half mile from the spill site, he said.

"It is completely contained and under control," Roberts said Thursday. "They got very lucky."