WASHINGTON (AP) _ The government's 28-month undercover pursuit of a Nebraska farmer convicted of receiving child pornography is providing a key Supreme Court test of sting operations.

The Bush administration said law enforcement officials acted properly to crack down on the ''kiddie porn'' industry that exploits children.

A lawyer for the farmer, Keith Jacobson, 61, said his client was the victim of government abuse and was illegally entrapped into committing a crime.

The justices, who heard 60 minutes of arguments in the case Wednesday, are expected to rule by July. They must decide whether by definition the government's conduct was illegal, and therefore the question of Jacobson's guilt or innocence should not have been left to a jury to decide.

The court also heard arguments in another closely watched case in which it is being asked to permit prayers at public school graduation ceremonies. The Bush administration and Providence, R.I., school officials urged the court to allow school-sponsored worship and lower the barriers separating church and state.

In the child pornography case, the administration said the government should have wide latitude in conducting undercover operations.

Justice Department lawyer Paul Larkin said it was not illegal entrapment to solicit Jacobson for 28 months until he ordered a magazine.

It takes time to catch those engaged in ''enticing, seducing and molesting children,'' he said.

Distributors of child pornography are ''very clandestine'' and ''cagy,'' he said.

''The government can't lean on you to force you to commit a crime,'' Larkin said. But he said in Jacobson's case there was ample evidence for a jury to decide he was predisposed to receiving illegal pornography.

''At no time did he call the police or throw these things away,'' he said.

Jacobson's lawyer, George Moyer, said the government violated his client's rights.

Moyer said ''It was crystal clear to the government'' after more than two years of mailed solicitations that Jacobson was not part of a ''child pornography underground'' that exploited or abused children. ''At that point, he should have been left alone.''

Jacobson attended the argument session. Afterward he stood before television cameras and reporters outside the court building and said, ''I made a mistake'' but accused the government of overreaching.

''I didn't know what was happening to me. I sort of got sucked in,'' he said. ''If I had been left alone, I wouldn't have bought'' the pornographic magazine.

The gray-haired Jacobson, who wore an American flag pin on his tweed jacket, said he is optimistic about the outcome of the case. ''I feel positive about it,'' he said. ''I figure it's in God's hands and the justices' hands.''

Some of the justices vigorously challenged Jacobson's lawyer during the one-hour argument session.

Justice Sandra Day O'Connor said Moyer's attack on government stings could threaten other undercover law enforcement operations, such as the use of pawn shops to catch people who steal property or purchase stolen goods.

''If you're correct,'' she told Moyer, ''then some of these pawn shops are operating illegally.''

Also at stake, she suggested, could be sting operations in which government officials are offered bribes. The high court has permitted such investigations.

Justice Antonin Scalia said the government may have had adequate evidence that Jacobson was predisposed to buy child pornography and therefore he was not entrapped by the repeated mailed solicitations.

Police found Jacobson's name on a San Diego, Calif., pornography bookstore's mailing list in 1984. He had ordered two nudist magazines from the store that were legal to purchase.

Jacobson, of Newman Grove, Neb., was convicted of receiving in 1987 a copy of a magazine called ''Boys Who Love Boys.'' A catalog advertisement for the magazine said would-be buyers could see ''11-year-old and 14-year-old boys get it on in every way possible.''

Jacobson was sentenced to two years probation and 250 hours of community service. He lost his job as a school bus driver the morning after he was charged and said he was ''humiliated and depressed'' for months.