But instead of lofting him into the upper ranks of Beltway bandits, where some other top soldiers have landed, his foray into consulting has become a legal and political quagmire, driven by the same disdain for boundaries that once propelled his rise in the military. His business ties are now the subject of a broad inquiry by a special counsel investigating Russian interference in the 2016 election and possible collusion with Trump associates. That investigation now includes work Mr. Flynn did for Russian clients and for a Turkish businessman with ties to that country’s president, Recep Tayyip Erdogan.

Mr. Flynn sometimes seemed to be trying to achieve through business what he could not accomplish in government. He believed that the United States was engaged in a “world war” against Islamist militants, and that Washington’s national security elite had so thoroughly politicized the country’s intelligence agencies that few left in government could see the threat. The United States, he believed, needed to take a tougher line against the Islamic State, and it needed to cultivate Russia as an ally in the fight…

But Mr. Flynn also became entangled with controversial clients. One company that paid him, OSY Technologies, is part of a cyberweapons company whose software has been used to hack Mexican activists and an opposition leader in the Middle East. Another, a Boston company selling a technology to replace lie detectors, is accused by its former chief scientist of marketing a counterfeit version of his technology to foreign clients.