House Speaker John Boehner has been quietly preparing to sue President Obama for months.

The Ohio Republican announced just last week that he would spearhead a House lawsuit against the president to challenge, in his view, the Obama administration's unconstitutional overreach of its executive authority and abrogation of laws passed by Congress.

Obama and congressional Democrats are calling the move a political stunt because of the timing of the announcement, which came less than five months before the midterm elections.

But Boehner actually started putting the lawsuit together in January.

Six months ago, at the speaker’s direction, House leadership aides began consulting with legal scholars and Republican staff on the House Judiciary Committee in preparation to jumpstart legal action.

During the intervening period, Boehner has leaned on Judiciary Chairman Bob Goodlatte of Virginia, and Reps. Ron DeSantis of Florida and Trey Gowdy of South Carolina for advice on how to put the House's case in the best position to be heard and decided favorably by the courts.

In interviews with the Washington Examiner, Gowdy and senior House GOP aides said that asking federal courts to rule on a dispute between the White House and Congress is a delicate legal and political matter that must be executed with a high degree of precision to even be considered.

Gowdy said federal judges are reluctant to accept cases like these, and that Boehner was correct to move deliberately.

“It has to be done right. Standing is a complicated issue,” said the former federal prosecutor, who in May was appointed by Boehner to serve as chairman of the special select committee investigating the Sept. 11, 2012, terrorist attacks on the U.S. consulate in Benghazi, Libya.

“I think if I were a judge, I'd say: ‘Hey, you have other remedies, you have appropriations, you have -- impeachment's not a remedy, it's a punishment -- but you have remedies,' ” Gowdy added. “However, access to the judicial branch is a remedy and it's been used in the past. If you look at [past cases,] there's a way to thread the needle, but it has to be done with precision, and I know that's what the speaker is trying to do.”

In July, after Congress returns from this week’s July 4 recess, Boehner will bring to the floor a resolution authorizing the lawsuit. There will likely be a separate vote to establish the House Bipartisan Legal Administration Group. The BLAG, as it is referred to, is comprised of the speaker, the majority leader, the majority whip, the minority leader and the minority whip, and is responsible for directing the House’s legal counsel on the matter.

The composition of the five-member BLAG, with three Republicans and two Democrats, ensures that counsel will act according to Boehner's wishes. The two Democratic members, in this case House Minority Leader Nancy Pelosi of California and Minority Whip Steny Hoyer of Maryland, cannot boycott the BLAG. Once the resolutions authorizing legal action and the creation of the BLAG have passed, the lawsuit can proceed and the specifics of the House complaint should begin to take shape.

Congressional Republicans have argued for at least the past year that Obama has ignored the law governing the application and administration of the Affordable Care Act, his signature health care overhaul often referred to as Obamacare.

They have also complained about executive actions his administration has taken that they contend subvert the laws passed by Congress, including regulations written by the Environmental Protection Agency to police carbon emissions by power plants.

They've also won an argument about checks and balances.

On Thursday, the Supreme Court unanimously ruled that Obama's recess appointment of three individuals to the National Labor Relations Board in 2012 was unconstitutional. House Republicans believe that decision will improve the chances of their lawsuit obtaining standing in court and winning on the merits.

“It means a ton, because it was nine to nothing, which means it’s not even close. And we told people it wasn’t going to be close,” Gowdy said.

In a statement on the ruling, Boehner linked it to the coming lawsuit.

“By invalidating these appointments, the Supreme Court has reaffirmed that the president cannot ignore the Constitution, and selectively interpret our rules and practices for his political purposes,” he said. “In the coming weeks, the House will take action to defend the Constitution and protect our system of government and our economy from continued executive abuse.”