In the lone debate of the Maryland governor’s race, Republican Gov. Larry Hogan and Democrat Ben Jealous sharply rebuked each other Monday in a feisty hour-long disagreement over whether the state needs a new direction.

The candidates described dramatically different views of Maryland’s challenges, talking over each other and saying the other lied about his plans for the future.

Hogan defended his record on education and the economy, describing his opponent’s attacks as delusional.

“Nothing you said is even remotely true,” Hogan said during an exchange about job growth. “It’s like you’re living in a dream world.”

Jealous, citing statistics about regional job gains, jabbed at Hogan’s assertion that he led the economic turnaround that followed the 2008 recession.

“That’s like taking credit for the sun rising,” Jealous said.

The candidates had never met before shaking hands less than five minutes before the debate, which was taped in the morning and was broadcast at 7 p.m. Monday on Maryland Public Television.

The stakes were particularly high for Jealous, who is outgunned financially, trails in recent polls by double digits and has been the target of a multimillion-dollar advertising campaign portraying him as “extreme.” Jealous’s cash-strapped campaign has largely left the attack ads unanswered on the airwaves.

Hogan continued to hammer messages from those ads, calling Jealous’s plans to increase teacher pay, provide state-run health insurance and reduce the prison population “reckless” and too expensive for the state.

Jealous repeatedly challenged Hogan, who is seeking a second term, to offer concrete plans for the future as the Democrat has, saying “you could go to benjealous.com” to see what a vision for the future looks like.

Hogan interrupted and answered the barb with humor.

“I’m not going to go to benjealous.com,” Hogan said.

The candidates stood at podiums on opposite sides of the stage, a setup that disguised the fact that Jealous is at least seven inches taller than the governor.

Even at a distance, the exchanges were often hostile.

When Jealous attacked Hogan’s handling of the opioid epidemic and mentioned that he had a cousin in rehab for heroin addiction, Hogan cut in to say he had a first cousin who died of an overdose.

At other times, the candidates used niceties. Jealous repeatedly called Hogan “sir” and the governor told Jealous that he “respected” his past work as head of the NAACP and his life story as the biracial son of a Maryland teachers who left the state because their marriage was not legal at the time. ­

The debate showcased the drastic differences between the ways the candidates view even the most basic facts about the state. After Jealous said Maryland was “dead last in the region with job growth,” Hogan responded, “We’ve had one of the greatest economic turnarounds in the nation.”

The encounter also underscored the contrasting ap­proaches Hogan and Jealous have brought to the campaign, with the governor pitching voters on four more years of stability and Jealous arguing that too many people have been left behind.

“It’s either you’re happy with the direction the state is going, or you want change,” said Mileah Kromer, a political-science professor at Goucher College. “For Hogan, stability is a positive. For Jealous, stability is not enough.”

Kromer said Jealous, who has $9 million less to spend on the campaign than Hogan, needed the debate to change the narrative around his campaign.

“He needed a moment to change the momentum,” Kromer said. His performance “helped to counteract any ideas of inevitability for Hogan.”

Jealous repeatedly tried to remind voters that Hogan, who has high approval ratings in deep-blue Maryland, is a Republican.

Jealous said Hogan twisted his proposal to reduce the state’s prison population — Hogan had said Jealous wanted to release “thousands of violent criminals” — and called it a classic GOP scare tactic.

“Your party plays by the same playbook: You lie and you scare people,” Jealous said. “I have not said anywhere that I would do what you are suggesting.”

Jealous also repeatedly brought up the Trump administration’s controversial education secretary, Betsy DeVos, and said Hogan, like DeVos, supports using tax dollars to fund private-school tuition.

Hogan shot back that his relationship with DeVos is limited to the time he sat beside her reading books to students at a Montgomery County elementary school.

“We weren’t going to tell her she can’t come into our state to read to kids,” Hogan said.

Democrats outnumber Republicans by 2 to 1 in Maryland, and a GOP governor has not won a second term here since 1954.

An emotional moment came near the start of the debate, when a Baltimore Sun reporter asked how each would prevent a workplace shooting like the one that killed five former colleagues at the Capital Gazette in June.

“My heart goes out to you, and you and your colleagues are heroes,” Jealous told her, before promising to close loopholes in laws affecting the sale and possession of guns.

“It’s tragic, and there’s no easy answer,” Hogan said, adding that he signed the “red flag” law that takes effect next month and will allow judges to order gun owners to temporarily surrender their weapons if they pose a threat to themselves or other people.

At the end of the debate, both candidates distanced themselves from President Trump when asked what they would say to him if given a minute in the Oval Office. Hogan said he would tell the president to stay off Twitter and quit being divisive.

“There’s not a lot I have in common with the president,” he said.

Jealous shot back that he would tell Trump “I wouldn’t aid and abet him the way our governor has.”

After the debate, Jealous supporters lauded his performance.

“This is the tipping point in this race,” said Brandon Scott, a Baltimore City Council member and former candidate for lieutenant governor.

Richard Vatz, a conservative professor of communications at Towson University, said that he did not think Hogan ceded any ground to Jealous and that both were aggressive. Vatz said he thought Jealous failed to explain why his proposals are needed or would be successful.

Both candidates claimed victory after the debate.

“He would prefer to run on mythology,” Jealous said. “I’m going to make sure he runs on his record.”

Hogan said he thought that the debate offered voters “a pretty clear definition of what the two of us are all about.”

Hogan said he is planning to traverse the state to meet with voters over the next several weeks.

“I’m not taking anything for granted,” he said. “I’m running just like I did last time. I’m running like I’m 20 points behind.”

Ovetta Wiggins contributed to this report.