It is the nightmare scenario for those who worry that the modern campaign finance system has opened up new frontiers of political corruption: A candidate colludes with wealthy corporate backers and promises to defend their interests if elected. The companies spend heavily to elect the candidate, but hide the money by funneling it through a nonprofit group. And the main purpose of the nonprofit appears to be getting the candidate elected.

But according to investigators, exactly such a plan is unfolding in an extraordinary case in Utah, a state with a cozy political establishment, where business holds great sway and there are no limits on campaign donations.

Public records, affidavits and a special legislative report released last week offer a strikingly candid view inside the world of political nonprofits, where big money sluices into campaigns behind a veil of secrecy. The proliferation of such groups — and what campaign watchdogs say is their widespread, illegal use to hide donations — are at the heart of new rules now being drafted by the Internal Revenue Service to rein in election spending by nonprofit “social welfare” groups, which unlike traditional political action committees do not have to disclose their donors.

In Utah, the documents show, a former state attorney general, John Swallow, sought to transform his office into a defender of payday loan companies, an industry criticized for preying on the poor with short-term loans at exorbitant interest rates. Mr. Swallow, who was elected in 2012, resigned in November after less than a year in office amid growing scrutiny of potential corruption.