The longest nationwide strike against General Motors in half a century ended on Friday after a solid majority of the company’s union members delivered their support for the four-year contract hammered out by their leaders.

The United Auto Workers union emerged with substantial wage increases and succeeded in ending a two-tier wage structure that had been a particular irritant in its ranks. It also won commitments to new G.M. investments in United States factories, while accepting the permanent shutdown of three plants already idled.

After almost six weeks on picket lines, some of G.M.’s 49,000 union workers could be back on the job Saturday morning, though it may take days to get back to full production.

“We delivered a contract that recognizes our employees for the important contributions they make to the overall success of the company,” G.M.’s chief executive, Mary T. Barra, said in a statement.