U.S. District Court Judge Walter L. Nixon Jr., the senior judge in the southern district of Mississippi, was indicted yesterday by a federal grand jury on three charges of perjury and one charge that he accepted three oil and gas well leases in return for assisting a drug suspect.

The indictment, handed down in Hattiesburg, Miss., charges that Nixon, 55, lied to the grand jury when he repeatedly denied that he had discussed the drug case with prominent Hattiesburg businessman Wiley Fairchild, whose son Drew Fairchild had been arrested in a marijuana smuggling case.

Nixon obtained three valuable oil and gas leases from the elder Fairchild several months after the son's arrest.

The indictment said Nixon, appointed to the federal bench in 1968 by President Lyndon B. Johnson, has received at least $60,000 in royalties from the leases since he obtained them Feb. 25, 1981.

Nixon entered a plea of not guilty yesterday to all the charges and asked to be relieved of his official duties. He was released on his own recognizance.

His attorney, Michael S. Fawer of New Orleans, told reporters he has asked Chief Judge Charles Clark of the 5th U.S. Circuit Court of Appeals to relieve Nixon of his duties pending the outcome of the trial. Fawer added that after the trial, Nixon "fully expects to resume his duties as a federal judge."

A source familiar with the case said that until several days ago Nixon was represented by former U.S. attorney general Griffin Bell. The source said Nixon disapproved of a plea bargain Bell was working out with government lawyers and replaced him at the last minute. Bell could not be reached for comment.

Nixon is the third sitting federal judge to be indicted for crimes while on the bench.

Last year, U.S. District Court Judge Harry Claiborne of Las Vegas was convicted of tax charges and sentenced to two years in prison and a $10,000 fine. Claiborne, who is appealing the charges, is still on the federal bench receiving his $73,000 salary, although he hears no cases.

U.S. District Court Judge Alcee Hastings of Miami was acquitted of bribery charges in 1983, but he is still the subject of a misconduct investigation by a committee of federal appeals court judges.

The Mississippi grand jury, which has been hearing evidence for more than a year, is being run by Reid Weingarten, a senior attorney in the Justice Department's Public Integrity Section, which investigates charges of wrongdoing by government officials.

Last September, the grand jury indicted Wiley Fairchild on perjury charges. Fairchild, who was accused of giving Nixon an illegal gift in exchange for "future official actions," later pleaded guilty to giving a gratuity to a public official.

Drew Fairchild was among six people arrested in August 1980 during the seizure of 2,200 pounds of marijuana at Hattiesburg Municipal Airport. He initially agreed to plead guilty to federal charges, but was never charged in federal court. He was later charged in state court and pleaded guilty to those charges.

The indictment charged that in February 1981, Nixon called Wiley Fairchild's lawyer repeatedly asking to become a partner in Wiley Fairchild's oil and gas investments. It also charges that Nixon knew about and "acquiesced in" the backdating of the oil and gas leases to make it appear that they were purchased before the arrest.

Nixon has said that he paid $9,500 for the leases in early 1980.

The indictment further charges that Nixon lied under oath to the grand jury when he denied that he discussed the case with Wiley Fairchild or Paul H. (Bud) Holmes, a former district attorney in Mississippi.

Holmes has pleaded guilty to a contempt of court charge in the same investigation.

The Justice Department said yesterday that the investigation is continuing. A source familiar with the case said that one area still under investigation is Nixon's involvement in the sale of Petit Bois, a 717-acre island off the Mississippi coast.

The island was bought in 1980 for $100 cash and a $1.7 million note by Florida businessman John R. Stocks.

The federal government, which had earlier announced plans to take the land for a federal park, claimed it was worth only $330,000. But in a 1982 opinion, Nixon ordered the government to pay nearly $9 million for the land, including interest.

Nixon faces up to five years in prison and a $10,000 fine on each of the three perjury charges and up to two years and a $10,000 fine on the charge of accepting a gratuity.