Former Philadelphia congressman Joshua Eilberg was sentenced here today to three to five years' probation and a $10,000 fine after he unexpectedly pleaded guilty to a federal conflict-of-interest charge.

Eilberg, 58, a Democrat, entered the plea as part of a plea bargain with the U.S. attorney's office that was hammered out at the last minute this morning, the day testimony in his trial was scheduled to begin.

U.S. District Court Judge Raymond J. Broderick, who had spent the last two days pondering complicated legal motions, reviewed the plea agreement in his chambers for about half an hour before agreeing to accept it "in the interests of justice."

He then released 15 jurors who had been sequestered since Wednesday, and sentenced Eilberg.

In addition to the probation and the fine, the maximum allowed under the law, Eilberg was ordered to work without pay six hours a week in some from of community service to be selected by the Justice Department.

Eilberg lost his bid for a seventh term in Congress in November shortly after he was indicted. Until today he had steadfastly maintained his innocence, asserting that the charge was the result of "bookkeeping irregularities"

He was charged with one count of receiving compensation for helping a Philadelphia hospital win a $14.5 million grant from a federal anti-poverty agency for a construction project. It is illegal for a congressman to receive compensation for services performed before a federal agency.

The plea bars Eilberg from ever again holding federal office. "I regret very much that I don't have an opportunity to run again for Congress. That's very important to me," he told the judge when asked for comment.

And it is expected that lawyer Eilberg will be disbarred from practice in Pennsylvania, because the charge is a felony.

The guilty plea came as a surprise to those closest to the case. Defense attorneys had vigorously deluged the court with pretrial motions that presented thorny legal issues. They were joined by lawyers from the U.S. House of Representatives who intervened to object to a subpoena for records.

In the courtroom today, 19-inch TV screens had been set up to air the videotaped testimony of the government's first witness, Stephen B. Elko, the former administrative assistant to Rep. Daniel Flood (D-Pa.)

Elko, the star witness, was expected to describe contacts by Eilberg and Flood with the executive office of the president to spur the release of the hospital grant money. Elko was unable to testify in person because he was hospitalized last week with a heart attack.

Prosecutors said later that Eilberg's attorneys had initiated the plea negotiations otiations. The idea of a guilty plea was broached Friday.

Besides fine and probation, the plea agreement provides for a government civil suit to try to recover from Eilberg about $20,000 -- the amount prosecutors said they would have proved at trial that Eilberg had received in violation of the conflict-of-interest statute.

Before agreeing to accept the plea, the judge listened to a lengthy summary of evidence the government intended to present. Then he turned to the defendant, who stood, ashen-faced, arms folded across his chest, at the bar of the court.

"Do you agree that that is substantially what took place?"

"Substantially, yes, sir," Eilberg replied.

"Are you therefore guilty of the crime that was charged in this indictment?"

"Yes, sir," Eilberg responded.

The case assumed national prominence last year when it was learned that Eilberg placed a call to President Carter to push for the removal of U.S. Attorney David Marston, a Requblican, who was investigating Eilberg's role in the Philadelphia hospital project. Marston was fired two months later.