William Munford Tuck, 86, a former governor of Virginia and Democratic congressman who was known for his unswerving devotion to racial segregation and fiscal conservatism and his opposition to unions and expanding federal powers, died yesterday at Halifax-South Boston Community Hospital in South Boston, Va. He had heart ailments and had suffered a stroke in 1976.

Mr. Tuck, who was born on a tobacco farm in Halifax County and lived in South Boston, embodied the conservatism of Southside Virginia and the legendary political machine of the late Sen. Harry F. Byrd Sr., which was supreme in Virginia from the 1920s into the 1960s.

As governor from 1946 to 1950, he once drafted workers of the Virginia Electric & Power Co. into the state militia to avert a strike threatened by the International Brotherhood of Electrical Workers. During his administration, Virginia passed its "right-to-work law," which forbids any requirement that employes be required to join a union as a condition of getting a job.

He denounced President Harry S. Truman's program to establish a permanent Fair Employment Practices Commission on the grounds that it was an unwarranted interference with states' rights and would help break down racial barriers. He refused to support Truman in the 1948 presidential election and also sought legislation from the General Assembly that would have allowed Virginia's presidential electors to vote for the candidate of their choice rather than follow the will of the voters.

While in Congress, where he served from 1953 until he retired in 1968, he was a leader in Virginia's efforts to organize "massive resistance" to the Supreme Court's decision in 1954 outlawing segregation in public schools. He fought all the federal civil rights legislation of the 1950s and 1960s.

"On this subject, I am not a 'gradualist,' I am a 'neverist,' " he said in regard to the Supreme Court decision.

Conventional as his views were in the context of the Byrd machine, "Bill" Tuck was unusual among his generally staid peers in his personal behavior. Outgoing, affable, salty--a Richmond newspaper once said that "his vocabulary began where the resources of Mark Twain left off"--he was known to leave the governor's mansion in an old car and drive to a cabin he owned in Halifax County. He would stay there until the state police found him.

On one occasion, he walked outside the state capitol and fired a pistol into the air. He said the idea was to test security arrangements.

The attributes that led to this sort of behavior led the senior Byrd to doubt Mr. Tuck's fitness for the state's highest office. Later, the senator became an outspoken admirer of Mr. Tuck.

In 1967, Mr. Tuck, troubled by cataracts and other health problems, announced that he would not seek reelection. He would be happier, he said, "back down there on my poor, rocky farm."

On hearing of his death, former Sen. Harry F. Byrd Jr. said, "Virginia has lost an outstanding son and I've lost one of my cherished and dearest friends. He was a great governor with unusual political courage. He fought hard for the principles of government in which most Virginians believed. We will not see the likes of him soon again."

When Mr. Tuck was born on Sept. 28, 1896, Virginia was almost entirely a rural state and the amount it spent on education and other public services was among the lowest in the country. But there were two things that distinguished the Tuck family. One was its abiding interest in politics and the other was its belief in education. The future governor's father even built a school on his property for the use of neighborhood children.

The young Tuck showed little interest in school work. He attended the College of William and Mary, where he excelled in athletics, enlisted in the Marine Corps in World War I, worked briefly--and surprisingly--as a teacher and principal in a rural school, and then decided to become an attorney.

He got his law degree at the Washington & Lee University School of Law and in 1921 established a practice in South Boston. It prospered and he remained active in it until he retired in 1979.

His involvement in politics came quickly and naturally. He was elected to the House of Delegates in 1923. In 1929, he resigned, saying that he needed to devote full time to law because of his marriage to the former Eva Lovelace Dillard, a widow. In 1930, he was persuaded to return to Richmond and in 1931 he was elected to the state Senate.

He remained there until 1941, when he was elected lieutenant governor on the ticket led by the patrician Colgate W. Darden. The senior Byrd had chosen Darden over Mr. Tuck in 1940. In 1945, Mr. Tuck's services to the organization and the strong backing he received from Darden persuaded the senator to endorse him for the governorship.

In retirement, Mr. Tuck remained something of a political power in the state. Candidates regularly sought his support. In 1975, Virginia's political elite--Republicans and Democrats alike--paid tribute to him in a celebration in South Boston.

"He stood as a stone wall on behalf of the right of the commonwealth," Mills E. Godwin Jr., then the governor and a Republican, said on that occasion.

Mr. Tuck's wife died in 1975. His survivors include a stepson, Lester Dillard, of South Boston, and three stepgrandchildren.