Sen. Harry F. Byrd Jr., asserting a political perogative many Virginia Democrats thought he had lost when he left their party, announced yesterday that he intends to play a role in the selection of U.S. judges in Virginia.

Byrd, who calls himself the Senate's only independent, said he was following a recommendation of President Carter and creating two citizen's commissions to advise him on who should be named to four prospective judgeships in the state.

Byrd's announcement apparently undercut a plan being circulated by Rep. Herbert E. Harris (D-Va.) for a similar commission that would have reported its recommendations directly to the White House.

Since Byrd left the state Democratic Party seven years ago, many Virginia Democrats - including Harris had assumed that Byrd would have no role in the selection of judges in the Carter administration. Byrd remarked to reporters during his recent victorious campaign against Democrat Elmo R. Zumwalt, that he was happy to be able to avoid such a "controversial" issue as selecting judgeship candidates.

Although judges supposedly are appointed by the President with the approval of the Senate, in reality a President must name a nominee acceptable to the senators from the nominee's state. If he does not, the President faces the risk that a senator, involving what is known as "senatorial courtesy," will declare the nominee personally unacceptable and block a nominee's appointment.

Despite his independent label, Byrd has continued to remain a member of the Senate's Democratic caucus. The caucus has allowed him to hold his seniority on committee assignments.

Byrd, shortly after being asked by a reporter for comment on the Harris plan, announced his own commissions and said his announcement was prompted by pending legislation that would create the four federal district judgeships in the state.

"I'll be darned," gasped Harris yesterday after being told of Byrd's statement. "I can't react to it now . . . As I said before, it (Byrd's position) is totally dependent on the way the White House wants to handle it."

Harris earlier had said that he had developed his commission plan "with some encouragement from the White House" - a position Byrd also adopted.

"The President in a letter to me suggested that I appoint a citizen commission for the state of Virginia to make recommendations for federal district judgeships," Byrd said. "I will follow the President's suggestion for I, like the President, feel it is important to seek the most qualified individuals to fill judicial vacancies."

Former Rep. Thomas N. Downing, a Virginia Democrat, was named by Byrd to head the nine-member panel that will advise him on who should fill the two proposed judgeships in eastern Virginia. The appointments "should be made on the basis of merit without regard to race, creed, color, sex or political affiliation," Byrd said.

Shortly before Byrd's statement, Joseph T. Fitzpatrick, chairman of the State Democratic Party, conceded in an interview that Byrd, because of membership in the Senate Democratic caucus, could, if he wished, control the judgeship nomination.

In December, Virginia Democrats wrote every Democrat senator urging them not to seat Byrd in the caucus, but as Fitzpatrick said, "nothing happened. The issue of Byrd's membership in the caucus was never raised.

"That being the situation, we've got to face reality," Fitzpatrick said. "The Democratic Party of Virginia can go only so far."

Under Byrd's proposal, the commission, comprised mostly of lawyers, will review candidates for the judgeships and give Byrd "the names of four or five individuals it finds most qualified." From their recommendations, Byrd said he will make his "suggestions" to the President.