The pilot at the helm of the cargo ship that caused a massive oil spill in the San Francisco Bay pleaded guilty Friday to two misdemeanor environmental crimes in exchange for prosecutors dropping felony counts.

Capt. John Cota entered guilty pleas to illegally discharging oil and killing birds as part of an agreement with federal prosecutors to drop two felony charges that Cota lied on annual medical forms required by the U.S. Coast Guard.

Cota would serve between two months and 10 months in prison under the plea bargain, but the deal needs the approval of U.S. District Judge Susan Illston. Cota is scheduled to be sentenced June 19.

Cota was at the helm of the 900-foot Cosco Busan when it slammed into the San Francisco-Oakland Bay Bridge in heavy fog on Nov. 7, 2007, and spilled more than 50,000 gallons of oil that killed and injured thousands of birds.

Federal prosecutor Jonathan Schmidt told the judge that Cota was responsible for the crash because of his failure to properly use the ship's navigation charts and equipment, and a lack of communication between Cota and the ship's Chinese master and crew. All container ships are operated by local pilots when they travel within San Francisco Bay.

"Captain Cota did not adequately review his intended course with the crew," Schmidt said. "Captain Cota's actions that day fell below the standard of care."

Cota's lawyer, Jeff Bornstein, told the judge his client was negligent on the morning of the crash, but others also share the blame.

"The crew was incompetent," Bornstein said. "The Coast Guard made mistakes."

The National Transportation Safety Board said last month that the Coast Guard failed to provide adequate medical oversight of the pilot.

The board also found that Cota's prescription medications impaired his performance and that the ship's Hong Kong-based operator, Fleet Management, Ltd., didn't properly train and prepare the crew.

The NTSB was told that Cota was prescribed many pills, including Lorazepam, an anti-anxiety drug, Imitrex for migraines, Provigil to increase wakefulness, and Darvon compound 65 for pain.

Fleet Management has pleaded not guilty to felony charges of obstruction of justice. The company was accused of ordering at least one Chinese crew member to alter documents after the accident.

Cota also faces fines, but his lawyer and prosecutors agreed to let the amount be determined by resolution of several lawsuits filed by federal, state and local governments to recoup the cost of the cleanup.

Copyright 2009 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.