Allegations of collusion between the Trump campaign and Russia have sparked charges and countercharges between the administration and its critics, and led to the appointment of a special counsel whose investigation has yet to run its course. But if Donald Trump colluded with Russia, it wouldn’t be the first time that a president colluded with a foreign power. The first time such collusion occurred, in the 19th century, the presidency had limited authority and a much smaller bureaucracy. That didn’t stop President John Tyler from manipulating and ignoring laws for political advantage, however. The difference: For Tyler, colluding with foreign powers was about averting war, not winning an election.

On April 4, 1841, following the death of President William Henry Harrison, Vice President John Tyler became the nation’s 10th president. The new president was immediately confronted with the possibility of war with Britain, a prospect he hoped to avoid. Such a war would have marked the third such conflict in a little over 60 years.

The dispute in 1841 was over boundaries between northern Maine and the province of New Brunswick in British Canada. Tensions had flared during the somewhat farcical Aroostook War of 1838-1839, and while no actual combat broke out, militia were in place on both sides. Armed conflict seemed inevitable.

Fighting a war with the world’s greatest superpower to seize control of hundreds of thousands of acres of trees in northern Maine was hardly a top priority for an “accidental” president in his first year in office. But standing up to Britain was important to the people of Maine and the nation. Animosity toward Britain appeared to be almost inbred in the American character.

Many Americans saw Britain as an “imperialist bully” or even an “evil empire.” At the same time, the notion of “manifest destiny” animated the American imagination, as it was assumed that North America was ours, and the time for the Old World to depart the New World was long overdue.

Secretary of State Daniel Webster presented an ambitious proposal to Tyler: a covert operation against the citizens of Maine to defuse the war fever gripping the state. Webster proposed using the president’s secret service fund (a fund devoted to activities akin to those of the Central Intelligence Agency today, not to protect the president) or contingency fund, to do this, even though the money was designated by law for foreign operations.

Tyler approved the operation, providing a down payment from the contingency fund of $3,500 (well over $100,000 in today’s currency), knowing that funding such a domestic initiative was illegal.

Webster hired a former congressman from Maine, Francis O.J. Smith, to bribe opinion leaders around the state to switch from a warlike stance to one favoring a negotiated settlement with the British. This covert propaganda campaign would, as Smith put it, “prepare public sentiment in Maine for a compromise of the matter.” Smith bluntly added that this goal could only be achieved “if it can be made to seem to have its origin with [the people of Maine] themselves.”

For over 10 months beginning in 1841, Smith and his operatives targeted “men of influence,” including businessmen, clergymen, lawyers and journalists — the last being of particular interest due to the warlike stance of most of the newspapers in Maine. Smith’s disinformation campaign was a remarkable success, as editors allowed him, for a price, to write anonymous editorials urging a negotiated settlement. Many of these essays were then reprinted throughout the nation as evidence that the citizens of Maine were unified behind a peaceful settlement with Britain. Smith’s goal was to blunt the “belligerent spirit” that animated political discourse regarding the border conflict, and he succeeded.

Perhaps most remarkably, Webster also asked the British foreign minister, Lord Ashburton, for British Secret Service funds to support the covert operation in Maine. The motive for seeking the aid of Her Majesty’s clandestine service remains a mystery. It is possible that Tyler and Webster realized at a certain point just how risky their operation was and concluded that if it were exposed, they ran the risk of impeachment. In case of exposure, it was far better to have a foreign secret service take the blame. In other words, British Secret Service funds provided some element of “plausible deniability” for Tyler.

Whatever the rationale, Ashburton made a payment of $14,500 (approximately $442,000 today) to a source he described as “my informant,” also known as Daniel Webster, who later observed that without this “stimulant” Maine would never have yielded on the boundary dispute.

The concerted campaign to, as Francis Smith put it, “adjust the tone and direction of the party presses, and through them . . . public sentiment” worked flawlessly. And, notably, without exposing the role of “official authority.” Webster could barely contain his delight that this “grand stroke,” this “movement of great delicacy,” resulted in a peaceful resolution of the border dispute with Britain with the signing of the Webster-Ashburton Treaty in August 1842.

Remarkably, the British role was not revealed until 1971, some 130 years after the fact, when an enterprising historian published the first account of Tyler’s covert operation.

Tyler and Webster believed that using covert means against their own citizens to avoid war overrode any legal prohibitions. They have not been the only ones. “When the president does it, that means it is not illegal,” claimed one of Tyler’s successors, Richard Nixon, who colluded with the South Vietnamese government to help secure his election as president in 1968 and would go on to meet an ignominious end by authorizing illegal acts.

The proclivity of presidents to believe that the fate of the nation rests in their hands, as the case of Tyler and Webster reveals, is almost as old as the nation itself. And so, yes, collusion is a presidential tradition, but a rarely used one that is also at odds with the principles and practices of most American presidents. It is particularly outside the mainstream when used for personal advantage, as Nixon did. What Tyler and Webster did was egregious enough, but they acted in the interests of the nation, not merely themselves.