Steven Hayden pleaded guilty to "without lawful authority [making] a damaging disclosure of a document relating to security or intelligence which was in [his] possession by virtue of [his] position as a Crown servant".
His case was sent to the Old Bailey for sentencing by the Chief Stipendiary Magistrate Graham Parkinson at Bow Street Magistrates in central London.
The court was told that Hayden sold information for about pounds 10,000.
Outside the court his solicitor said the chief petty officer had sold details of an anthrax threat to Britain by Iraqi leader Saddam Hussein to the Sun newspaper.
Hayden, 30, from the Portsmouth area, is still serving in the Royal Navy but he has since been moved from his previous post and was serving on HMS Nelson.
His lawyer, David Lancaster, said that a jail sentence would end his time in the Royal Navy.
"It is quite clear his career is finished," said Mr Lancaster. "He will sorely miss the services."
He told the court that his client sold the information to relieve "tremendous financial pressures".
Mr Lancaster said the money was supposed to be used to pay off Hayden's debts but said that only about pounds 2,000 of it had been used for this purpose.
He said that a lot of the cash was spent on household luxuries, and an additional amount paid for the funeral of Hayden's second child, who had died at birth.
The money was stored in a brown envelope in a wardrobe at Hayden's house because it was claimed that it would rouse suspicion if he began to use the money to pay off all of his debts.
Hayden was granted bail on the conditions that his passport remains with the Royal Navy, that he does not talk to any members of the press and that he resides at his home address.
Passing the case to the Old Bailey for sentencing, Chief Stipendiary Magistrate Mr Parkinson said that the public must expect an offence of this nature to be given a "sentence which reflects the gravity of the offence".
He ordered a series of pre-sentence reports which were to be written before Hayden was sentenced at the Old Bailey for an offence which carries a maximum prison term of two years.
After the hearing Mr Lancaster made a brief statement outside the court and said that a number of "crucial personal issues" relating to his client would be brought before the sentencing court.
He said: "Having pleaded guilty to selling information to the Sun newspaper, my client is still bound under the restrictions of his bail from talking to the press."Reuse content