TOKYO, AUG. 31 -- Ruling and opposition party leaders agreed today on a draft of a new constitution for South Korea, taking an important step toward democracy after years of military and authoritarian rule.

The constitution, which must be approved by the National Assembly and by the public at a referendum, would permit the election of a president by direct popular vote late this year. This was the key demand of protesters whose street demonstrations shook the nation in June. It would be the first genuinely contested election since 1971.

The agreement today came after a month of negotiations between four leading politicians from the ruling Democratic Justice Party and four from the Reunification Democratic Party, the principal opposition group. The leaders of the two parties, Roh Tae Woo and Kim Young Sam, respectively, are expected to meet later this week.

Talks had stalled previously on several issues, including the opposition's desire to lower the voting age to 18 or 19. The ruling party prevailed in that dispute, leaving the age at 20.

But the opposition won on several important points, including limiting the president's power to declare martial law and ending his power to dissolve parliament. Both were considered key issues in a nation whose leaders have repeatedly responded to political challenges with repression.

Leaders of both parties were eager to complete the negotiations in order to persuade voters that they are committed to rapid democratization. They also wanted to show progress this week as students return to the universities.

Student protests that had strong middle-class backing forced the government to agree in June to direct elections to replace the present electoral college system. This prompted the drafting of a new constitution. Many diplomats and politicians in Seoul have said that middle-class support for future demonstrations may depend on how quickly politicians seem to be moving forward.

"The main thing is to realize the election," said Park Yong Man, an opposition party negotiator. "In order to make the election a reality, we've had to make whatever concessions are necessary. That's why we even had to compromise on voting age."

Leaders also hope the draft will help quell labor unrest, which has affected more than 2,000 companies this summer. The new constitution would guarantee the right to form unions, to bargain collectively and, for most employes, to strike.

In the latest such dispute, representatives of 14,000 company-employed taxi drivers in Seoul voted to strike Tuesday. Police said the strike could disrupt traffic, since 15 percent of Seoul commuters use taxis, and might spark violence between striking drivers and more than 24,000 owner-drivers who are expected to keep working.

Politicians also want a new constitution because at this moment each side believes it can win an election, one western diplomat said.

"Both sides want to play the game, so they have to agree on the rules," he said.

Other features of the draft constitution include: A pledge of military neutrality in politics, as the opposition demanded, but not spelled out in the preamble, a concession to the ruling party; A single five-year term for the president, with no vice president. The opposition wanted a U.S.-style system with two four-year terms and a two-person ticket, but the draft more closely approaches the ruling party proposal to replace the single seven-year term required by the 1980 constitution with a single six-year term and no vice president.

The preamble does not include a tribute to civilians killed by soldiers during a 1980 uprising in Kwangju. The ruling party had opposed such a reference.

The government dropped its insistence that presidential candidates be resident in South Korea for the five years preceding the election. This requirement would have eliminated opposition leader and recent exile Kim Dae Jung as a candidate.

Politicians hope that a National Assembly committee can draft exact language by Sept. 10, paving the way for parliamentary approval and a referendum in early October. That would allow a presidential election in mid-December.Special correspondent Young Ho Lee contributed to this story.