For more than two decades, Taiwan tried to buy a fleet of modern conventional submarines to fend off an existential threat — invasion by China. There were no takers.

The United States, Taiwan's main ally, has a nuclear-powered fleet and hadn't built diesel-powered subs in decades. Other nations balked, fearful of angering Beijing.

Now, as China under President Xi Jinping steps up its military intimidation of Taiwan, an array of foreign submarine-technology vendors, with the approval of their governments, are aiding a secretive program to build subs in Taiwan. Taipei has stealthily sourced technology, components and talent from at least seven nations to help it build an underwater fleet with the potential to exact a heavy toll on any Chinese attack, a Reuters investigation has found.