Maryland Gov. Harry Hughes appointed veteran Prince George's County legislator Gerard F. Devlin to a District Court judgeship today in a move that was widely regarded as part of an effort by Hughes to shore up political support in the county as he runs for the Democratic nomination for U.S. Senate.

Devlin, 52, has been a Democratic member of the House of Delegates since 1975, and has served as vice chairman of the influential Ways and Means Committee, which considers tax legislation. The Bowie resident will fill a District Court vacancy created by the retirement last month of Judge Bond L. Holford. The position pays $57,400 a year. District Court is the lowest of Maryland's state courts, handling traffic cases and other minor violations.

A native of Boston, Devlin is a graduate of Suffolk University in Boston and the University of Baltimore School of Law. In the legislature, Devlin earned a reputation as a shrewd and bright lawmaker whose wit made him a favorite among reporters.

During the 1986 legislative session that ended two weeks ago, Prince George's County politicians had confidently predicted that Hughes would name Devlin to a judgeship shortly after the session concluded in appreciation of the political support given the governor by Rep. Steny H. Hoyer.

Today, one prominent county political figure who asked not to be named attributed the appointment to "the governor's longstanding and close relationship with Hoyer -- that's the alpha and omega of it."

Hoyer, a founder of the Prince George's County Democratic organization that still holds considerable sway in the county, publicly endorsed Hughes' Senate candidacy last summer over the objections of some other officeholders who viewed the governor as irreparably damaged by the state's savings and loan crisis. Hoyer also served as master of ceremonies at Hughes' fund-raiser in Baltimore on April 10.

The congressman's backing has returned significant dividends to the county's legislative delegation, among them $2.5 million in additional money for magnet schools.

According to one county politician, a former Hoyer aide recently compared the congressman's endorsement to "a credit card -- Steny keeps drawing on it."

"It's not like I made a deal," Hoyer said today. "But I don't think it hurt that I was for Harry, and also for Gerry. [Devlin] is exactly the kind of guy you want on the District Court. He's bright, but a down-to-earth, common-sense guy."

In recent years, Hughes has sometimes angered Prince George's County political figures with his executive appointments, but he has generally worked himself back into their good graces during election years. Today's appointment was reminiscent of his appointment of state Sen. John J. Garrity to a Court of Special Appeals vacancy three months before the 1982 Democratic primary in which Hughes ran for reelection.

Asked today if there was an element of senatorial politics in the Devlin appointment, Hughes' press secretary Hirsh Goldberg replied, "Not to my knowledge." Hughes himself was vacationing in Florida and was unavailable for comment.

The governor's appointments aide, Constance Beims, said that Hughes had named Devlin over seven other people also recommended by a judicial nominating panel "because he thought [Devlin] would be a good District Court judge -- he certainly has a long background of public service."