A former Montgomery County police informant was automatically sentenced to life in prison yesterday after a jury deadlocked over whether he should receive the death sentence.

The jury deliberated for three hours on what the judge called the awesome task of deciding if James T. Porter should live or die. The same jury had convicted Porter Friday of murdering a Frederick County father of seven during a gasoline station holdup last November.

As he had throughout the four-day trial, Porter, 22, of Silver Spring, sat impassively as the jury declared itself deadlocked and Anne Arundel Circuit Judge E. Mackall Childs pronounced the only sentence possible under Maryland's recently enacted capital punishment law.

The youth, who had worked as an informant for both the Montgomery County Police and the Treasury Department's Bureau of Alcohol, Tombacco and Firearms, contended throughout the case that the murder was committed with his gun by another man.

Four days after the murder of gas station attendant John R. Culb of Myersville, Porter called the victim's family seeking a reqard for the return of Culb's wallet. Porter testified he did not know Culb had been murdered and said he obtained the wallet from a friend.

Police had initially charged another man, Charles Joseph, with the robbert and murder, until prosecutors became convinced Joseph had been working in North Carolina at the time.

Among the state's witnesses against Porter was his brother William, who said the defendant told him about the robbery. William Porter had been with his brother that night but was sleeping off the effects of cocaine and could not recall events.

When James Porter had been an informant, he provided information that led to the arrest of his brother. This time, William Porter received limited immunity in return for his testimony against James.

"I don't know what to attribute it to, but the family is still cohesive," their mother Catherine Porter said yesterday. "And Bill's as concerned for Jim as he was for himself."

Before the jury began deliberating yesterday, James Porter testified that he was a regular churchgoer trying to help police solve the murder of Culb, a state farm bureau accountant who worked part-time at the gas station to supplement his income.

Porter's parents and pastor also testified on his behalf.

In seeking the maximum penalty, Frederick County State's Attorney Robert S. Rothenhoefer alleged that Porter's courtroom manner -- which betrayed no "outrage, anger, concern or surprise, no emotion" -- showed him to be a calculating, cold-blooded killer whose eventual release under a life sentence would constitute a "continuing threat to our society."

Douglas R. Taylor, Porter's lawyer, said his client's "shy, reticent, retiring personality should not be held against him." He noted that Porter had no prior arrest record -- other than those staged in his informant role -- and declared the evidence insufficient "to put this man in the gas chamber."

Maryland's gas chamber has not been used since July 1961. So far, under the 13-month-old capital punishment law, one person has been sentenced to death. Porter faces a further sentencing Oct. 1 on one count of armed robbery and two handgun charges stemming from the holdup-murder.