The state's Democratic leaders and Republican Gov. Chris Christie made the announcement in separate news conferences Monday night.
Christie signed the budget early Tuesday morning, which would reopen state parks in time for the holiday and all state government offices on July 5.
The government shutdown had catapulted Christie back into the national spotlight -- especially after photos emerged of the governor and his family lounging on an empty beach that had been closed due to the budget deadlock.
On Friday night, Christie had shut down the Garden State government after the state Legislature failed to pass a budget
by the July 1 deadline. The shutdown furloughed an estimated 30,000 to 35,000 state workers and forced the temporary closure of state parks, beaches, recreational areas, and historic sites as the July 4 holiday neared. The Legislature went back into session Monday in an attempt to break the deadlock and came to a compromise.
The governor blamed the impasse on state lawmakers.
"If they had sent me a budget, there would have been no shutdown," he said. "I can't sign a budget that they didn't send me."
Christie: 'I don't care about political optics'
Christie came under fire Monday after local media sources released photos of the governor and his family on a deserted beach outside the governor's residence on Island Beach State Park, one of many closed to the public as part of the shutdown.
Backlash was swift against Christie. Even his own Republican lieutenant governor, Kim Guadagno, questioned the governor's decision.
Christie shot back at the criticism Monday night during his press conference.
"I don't care about political optics. I care about right and wrong. If I have a choice to make between my family and political optics, I choose my family," he said during his press conference.
Christie said his son had invited his friends over for the Fourth of July weekend.
"We don't get a lot of time to spend as a family together," the governor said. He added that he wasn't going to cancel family plans because state assembly Speaker Vincent Prieto, a Democrat, couldn't get enough votes for a budget.
Christie defended the family outing, saying they are permitted to be at the governor's summer house at any time. "Let's be really clear, that's our residence. We have a right to be there whenever we want to be there," he said.
Christie said that the photos suggested that "no one was on the beach in New Jersey yesterday but me -- that's what the pictures implied. That's what national media was erroneously reporting."
He said that 119 miles of New Jersey's 130 miles of coastline were open during the shutdown.
"Shame on those people who wanted to make this as if we were taking advantage of something," he said.
How New Jersey government went to a shutdown
According to nj.com
, the conflict in the Legislature was about the finances of not-for-profit Horizon Blue Cross/Blue Shield, the state's largest health insurer.
The state Senate passed a bill that allows the state government to control how much Horizon keeps in its surplus fund before it must contribute to a public health fund. Christie said he could accept that bill.
But Prieto, the state assembly speaker, had refused to allow the bill to come to a vote in the House, nj.com reported.
On Monday night, the legislature reached a compromise and Prieto said a cap would be placed on the reserves and anything in excess will go back to the subscribers.
"This is something I can put my name on," Prieto said in a press conference Monday night.
He appeared with New Jersey state Senate President Steve Sweeney, also a Democrat, at a news conference Monday.
"The most important thing is, we opened the state of New Jersey again. We put back to work all those workers that did not get to go to work today. We opened all those beaches, all those services," Prieto said.
During the three-day shutdown, Christie had signed a state of emergency permitting the operation of essential government services such as state police, correctional facilities, welfare services, state hospitals and treatment facilities. Also shielded from the shutdown were New Jersey Transit, the state lottery, casinos and racetracks.
Christie plans to head 'back to the beach'
This is Christie's second and last term as governor. He leaves office in January.
As he prepares to leave office, Christie is the most unpopular governor
in the country, according to pollsters. A Quinnipiac poll
from June placed his approval rating at 15%.
"I don't apologize for it. I don't back away from it," Christie said over the beach photos. "I think my poll numbers show that I don't care about optics."
Christie also noted that as soon as he and the state legislature finished work for the night, he planned to head "back to the beach."
"Whenever I get done tonight, I'll go back to the beach. That's where my family is and that's where I'll go back to," Christie said.