A Maryland legislative panel voted unanimously Tuesday to approve a $20 million grant for defense giant Northrop Grumman, but not before top lawmakers scolded Gov. Larry Hogan (R) and his administration for not collaborating more with the General Assembly on the deal.

“We had to do what we had to do because it was the right thing to do, but it wasn’t handled the right way by the executive or your office,” Senate President Thomas V. Mike Miller Jr. (D-Calvert) told state Commerce Secretary R. Michael Gill.

The grant, approved by the legislature this year, was designed to ensure that Northrop would maintain a strong presence in Maryland. The company must repay some or all of the money if it fails to keep at least 10,000 jobs in Maryland for the next 10 years and invest $100 million in capital projects in the state.

The deal nearly fell apart after Hogan refused to release $25 million that Democrats set aside for teacher pensions and school construction as part of an $80 million all-or-nothing spending package that included items the governor opposed.

[Hogan keeps most of legislature’s ‘fenced off’ money for rainy-day fund]

The General Assembly’s Legislative Policy Committee, which had final say over whether the grant would move forward, postponed a meeting this summer to review and potentially vote on the agreement.

Miller and House Speaker Michael E. Busch (D-Anne Arundel), who jointly head the panel, suggested at the time that they didn’t have enough votes to greenlight the deal in light of Hogan’s decision on the all-or-nothing spending package.

The standoff ended last month, with the committee agreeing to approve the grant in exchange for Hogan supporting legislation next year that would provide equivalent funding to help local school districts pay for teacher pensions. Busch and Miller also agreed to round up legislative support for a deal the governor made with Marriott International to give the hotel company about $20 million in state funding to keep its headquarters in Maryland.

Busch asked Gill what he would do differently with future deals requiring legislative approval, but the secretary said he “wouldn’t change anything,” insisting that he stayed engaged with lawmakers throughout the process to communicate the administration’s goals.

Miller interjected, saying that “government is a team effort.” He added that Hogan “should have called a meeting with you, the speaker and myself and the chairmen of the various committees involved in the House and Senate and said, ‘What can we all agree upon?’ ”

Hogan spokesman Doug Mayer said the governor had “many conversations” with Miller while negotiating the Northrop deal.

“We’re not going to let his dour tone dampen what is clearly a great bipartisan achievement to continue a very prosperous partnership with this important Maryland employer,” he said. “We couldn’t be more thankful to both presiding officers for their help in this collaborative effort.”