TAIPEI -- The race to become the opposition party's nominee in Taiwan's 2020 presidential election is shaping up as a duel between Foxconn founder Terry Gou and the mayor of the island's largest southern port city, though both candidates are struggling to find the right distance from Beijing amid growing skepticism here for mainland China.

Han Kuo-yu, mayor of Kaohsiung, has been leading in polls as the leading candidate for the Beijing-leaning Kuomintang. But Gou is catching up.

Taiwanese broadcasts and social media teem with campaign ads for Gou, who resigned recently as chairman of the electronics contract manufacturer known formally as Hon Hai Precision Industry. The magnate is aggressively tapping his personal fortune, estimated at $6.3 billion, and has even pledged to use his wealth to fill budget shortfalls for his policies, including free child care for kids 6 and younger.

Meanwhile, Han has dubbed himself a "vegetable seller" and "commoner president," playing up his experience running a vegetable grocery business. He continues to draw ardent support from voters who are frustrated by the island's growing wealth gap.

Five candidates seek the party's nomination. Kuomintang will announce the winner as early as Monday based on opinion polls, and make the decision official at a party congress July 28.

Private-sector polls showed Han with a double-digit lead over rivals until late May. A TVBS poll that month placed him at 35% approval, compared with 20% for Gou. But Han lost momentum over the large-scale demonstrations in Hong Kong against a bill allowing extraditions to the mainland.

Gou and most Taiwanese lawmakers swiftly distanced themselves from Beijing in response to the protests, which also fanned anti-mainland sentiment in Taiwan. But Han said he knew little about the demonstrations, prompting many news outlets to slam him as pro-Beijing.

The mayor later backtracked his statement, saying he would never allow China's principle of "one country, two systems" for Hong Kong to become a reality in Taiwan. Still, the latest polls show Gou moving within several percentage points of Han.

Yet the Foxconn founder also faces criticism over his ties to China. More than 70% of the company's fixed assets are on the mainland, though Gou said in June that he could move those facilities abroad at any time.

The Kuomintang won a decisive victory against President Tsai Ing-wen's Democratic Progressive Party in last year's local elections, an important step toward retaking the government. But Tsai has quickly gained in the polls as Taiwan's public grows more wary of the mainland, leaving whichever candidate wins the Kuomintang nomination to face a tough battle leading into the election in January.