CHICAGO -- For a few quiet hours  Wednesday, the fate of Gov. John Kasich's presidential campaign seemed to rest in a Harrisburg, Pa., courtroom. By  day's end, Kasich's state campaign might have been rescued by a simple question: Can you still knock someone off the ballot if you showed up too late to complain?

On Feb. 23, the chairman of Pennsylvania Students for Rubio, Nathaniel Rome, filed a challenge to Kasich's ballot petitions, arguing that he clearly had not earned a place for the April 26 primary. Kasich's campaign had filed  2,184 signatures when 2,000 were required -- a red flag for any candidate. Ten years ago, for example, a Green Party candidate for U.S. Senate in Pennsylvania turned in about 94,000 signatures when 67,070 were required. More than a third of them were found to be flawed, and the candidate was bounced.

Rome's challenge, in the Pennsylvania Commonwealth Court, claimed to see a similar pattern in the Kasich signatures. Perhaps 802 of the Kasich signatures were flawed, argued Rome and his legal counsel -- whose brother chairs Rubio's campaign in Pennsylvania.

"The challenge isn't going to work," said Kasich spokesman Chris Schrimpf. "It is a waste of Rubio's time and effort. He should focus on trying to win his home state."

Yet the March 9 hearing over this challenge threatened to devastate the Kasich campaign. Kasich, who was born in a small western Pennsylvania town, has long seen the March and April swath of rust belt and Midwestern primaries as his ticket to the Republican National Convention. "I can't wait to go to Pennsylvania," he told reporters in Michigan on Tuesday.

Kasich's relatively simple plan for the next week was to perform well in the final debate, hunker down in Ohio, and then win the state as Rubio -- Nathaniel Rome's candidate -- headed to a campaign-ending finish in Florida. A headline about Kasich being taken out of a delegate-rich primary in the state where he was born would have roiled all of that.

The headline never came. Kasich's legal team came to court with a very simple argument. Petitions for the Pennsylvania ballot were due by 5 p.m. on Feb. 16. Had they been turned in one minute later, they would have been invalid. The window for a challenge was seven days. And Rome had turned in his complaint seven days later -- at 5:13 p.m.

"A full seven days is 5 o’clock, seven days later," said Lawrence Otter, the attorney representing Kasich.

Phil Kerpen, a conservative activist who'd been watching the case with a critical eye, quickly tweeted that Rome bungled it.

Even a delay in the decision, past the Florida primary that Rubio is now expected to lose, might have ended the threat to Kasich. After two Wednesday stops in Illinois, where the candidate hopes to replicate the strength he showed in the Detroit suburbs, Kasich got no questions about Pennsylvania but several about where he could win next. He was "surging" in places like the Chicago suburbs, he said, and he would put away Ohio on March 5.

"What makes you think that you're going to do better in Ohio, especially with recent polls showing that you're stalled out?" asked a reporter.

"Yeah, but when did they take it?"  Kasich asked. "You don't want to have a debate about polls. Look: You think I'm stalled out? Come to Ohio and we'll see."