A New York man was sentenced Monday for sending more than 9 million spam advertisements in online instant messages to members of a networking Web site in a hearing that was closed to the public.

The sentence is under seal and the session was closed at the defense attorney's request.

Anthony Greco (search), 18, of Cheektowaga, N.Y., agreed earlier this year to plead guilty in a deal that would result in a sentence of 18 months to two years in prison, according to federal court documents.

Greco admitted sending messages to the Los Angeles-based Web site MySpace.com, threatening to share his spamming techniques with others.

Hoyt Sze of the federal public defender's office declined to comment on the reason for the closed session and would not confirm if Greco had received the sentence outlined in the plea deal.

Federal prosecutors will ask the judge on Tuesday to make the sentence public, spokesman Thom Mrozek said.

MySpace.com provides a free forum for members interested in such things as chatting online, meeting others with similar interests, keeping in touch with family members and finding old friends.

According to the plea agreement, MySpace hired Greco to write a computer program that would send its users instant message ads for adult and mortgage refinancing Web sites. He then created 27,000 fake MySpace accounts through which he sent the spam last fall, according to the plea deal.

After sending the spam e-mails, Greco contacted MySpace and requested permanent employment to guard against more spam and to get exclusive rights to send commercial e-mail through the site. When his request was ignored, prosecutors said, Greco threatened to tell others how to spam MySpace users.

The company, whose parent agreed in July to be acquired by media giant News Corp., spent more than $20,000 deleting unopened messages from its computer servers, fortifying its system and addressing customer complaints, authorities said.

FOXNews.com is a unit of FOX News Channel, which is owned and operated by News Corporation.