The Senate voted 63 to 31 along party lines yesterday to confirm Edwin Meese III as attorney general after breaking a bitter four-day impasse over emergency farm credit relief that severely tested the authority of new Senate Majority Leader Robert J. Dole (R-Kan.).

Confirmation of Meese, President Reagan's counselor for the last four years, came after a grueling year-long probe into his personal affairs that included an investigation in which an independent counsel concluded that he had not violated any law.

But echoes of the controversy continued as Senate critics, all Democrats, charged that Meese failed to meet high standards that should be required for the nation's top law-enforcement officer.

While Republicans held firm for Meese and were joined by 15 Democrats, the number of votes against him was the highest against a Cabinet nominee in 14 years. According to Common Cause, the self-styled citizens lobby, it was the largest vote against a nominee for attorney general since 1925.

Speaking to reporters outside the White House late yesterday, Meese said he is "not bitter at all" as a result of the long confirmation struggle and expects no problems in working with the Senate "in a spirit of reasonableness." Meese said he will be sworn in informally by a notary public on Monday, and a formal ceremonial swearing-in will be held two weeks later, to be followed by his first news conference.

Meese succeeds William French Smith, who is retiring to return to private life.

The Democratic filibuster that held up Meese's nomination for nearly a week was aimed not at him but rather at forcing liberalized loan provisions for thousands of financially hard-pressed farmers.

The result of that struggle remains inconclusive. Under pressure of the filibuster, the Reagan administration acted on its own to implement slightly modified loan provisions spurned by Democrats as inadequate. But the Democrats won an opportunity for votes in the Republican-controlled Senate next week on further farm relief legislation that is moving through the Democratic House.

Compromise on procedures for considering further farm-credit legislation was reached after a protracted, rancorous Friday session during which Democrats accused Republicans of "hardball" tactics and Republicans accused Democrats of trying to usurp Dole's authority only a month after he became majority leader.

Rarely has the Senate been so paralyzed and polarized so early in a session. The situation prompted Minority Leader Robert C. Byrd (D-W.Va.) to warn of "long and difficult" days ahead and lawmakers of both parties to grimace at the thought of even more difficult budget battles ahead.

But the episode appeared to serve as a catharsis, and tempers subsided as senators gathered for a rare Saturday session under a stern warning from Dole that they would be meeting round the clock starting Monday unless they broke the farm stalemate in the meantime.

Dole broke the impasse by offering Byrd a procedural compromise under which Republicans and Democrats could offer four amendments each on farm credit relief to an African famine relief bill that the Senate will take up Monday.

Byrd accepted the offer and a relieved Senate went along without dissent, paving the way for quick action on Meese and equally expeditious approval of a long-delayed bill allocating more than $7 billion in construction money for interstate highways and other transportation projects. That bill frees highway money held up since last year because Congress had not approved the cost estimate for completion of the interstate system.

Then it gave its approval, without dissent, to a "sense of the Senate" resolution incorporating the farm-relief pledges that Agriculture Secretary John R. Block made last week on Reagan's behalf to guarantee "adequate" farm loans and loan guarantees under slightly liberalized terms.

Asked after the impasse was broken why he made the first move yesterday morning to reach a compromise, Dole responded, "Well, I'm the leader and the leader makes the first move."

For a while, angry Republicans contended that Dole's leadership was in doubt as Democrats, using their filibuster as leverage, sought to win guarantees for consideration of amendments they wanted for further farm relief in connection with the African aid legislation.

"It the fight has nothing to do with the farm crisis; it has nothing indeed to do with Mr. Meese," said Sen. John H. Chafee (R-R.I.), the third-ranking Republican leader, as his battle-weary colleagues attempted to patch over their differences yesterday. "The point before us is who is going to run the show -- the majority leader or a group over there the Democrats who seem to have taken charge."

Democrats denied the GOP charges but also appeared to enjoy the spectacle of Dole, who has earned widespread praise for his take-charge leadership style, getting caught in the same kind of filibuster morass that plagued his predecessor, former senator Howard H. Baker Jr. (R-Tenn.).

"There was a lot of machoism going on last night," said Sen. Edward Zorinsky (D-Neb.) in apparent reference to Dole's threats. Some Democrats also suggested that Dole's real challenge came from from conservatives in his party, such as Sen. Jesse Helms (R-N.C.), who reportedly was pressing hard for a hard line against compromise with the Democrats and threatening to offer amendments on touchy subjects such as abortion, school prayer and busing. Some Republicans conceded they were as worried about renegade Republican amendments as they were about any farm-related proposals the Democrats might throw at them.

The procedures adopted yesterday allow amendments only on farm-related matters.

But possibly the biggest factor complicating the farm fight -- one that is certain to continue this week as new farm legislation is considered -- is the political profit at stake for the 1986 elections, when the Republicans' four-vote edge in the Senate will be in jeopardy.

Hundreds of farmers and farm-state public officials, including the entire South Dakota state legislature, are expected to descend on Washington next week as the traditional March 1 deadline for refinancing of farm loans approaches.

Several farm-state Republicans, including Sen. James Abdnor (R-S.D.), are considered vulnerable in 1986, and one of the farm credit measures that the Senate will consider next week is being pushed in the House by Rep. Thomas A. Daschle (D-S.D.), who may run against Abdnor