CARACAS, VENEZUELA, OCT. 1 -- A raucous political battle ended today when Venezuela's ruling party chose a controversial former president to run for reelection.

Unofficial results gave a wide margin of victory to former president Carlos Andres Perez, a populist favored by labor, feared by foreign bankers and strongly opposed by current President Jaime Lusinchi.

Over the course of the two-year campaign, tensions between the Lusinchi and the Perez factions came close to splitting the Democratic Action party. Perez struck a conciliatory note when he told celebrating supporters, "To all those fellow party members who did not vote for me, my hand is extended. And now, let's put our hands to work."

The task clearly indicated is to reunify the party, which founded Venezuelan democracy 40 years ago and remains the largest in this country of 15 million people. The voting was by 50,000 party officials.

Workers fondly remember Perez, 64, as the president who imposed restrictions on firings and pushed through a host of social legislation during the oil boom that coincided with his 1974-79 administration. It nationalized the petroleum industry.

Perez is remembered as the Latin American leader who helped lend legitimacy to Nicaragua's Sandinista revolutionaries in their battle against dictator Anastasio Somoza. His administration provoked widespread charges of financial mishandling.

The constitution requires a two-term lapse before a president can attempt to return to office. Lusinchi tried to impose on the party former interior minister Octavio Lepage.

With Lusinchi's help, Lepage's backers won control of party election machinery two years ago. But Lepage let his early advantage slip away by mounting a colorless campaign.

Polls have indicated for two years that Perez would easily defeat Lepage if his party put its choice for president to a popular vote. No ruling party has been reelected for 20 years, but this one is the front-runner for the election scheduled for December 1988. The Christian Democratic Copei party still suffers from the unpopularity of its last president, Luis Herrera Campins.