The B.C. Green Party has agreed to support the NDP in the legislature, setting up the possibility of 16 years of Liberal rule coming to a dramatic end.

NDP Leader John Horgan and Green Party Leader Andrew Weaver made the joint announcement Monday afternoon at the B.C. Legislature, saying they had reached a four-year agreement.

"In the end, we had to make a difficult decision," Weaver told reporters, describing the negotiating sessions his party held with the NDP and B.C. Liberals since election night ended without a definitive result three weeks ago.

"A decision we felt was in the best interest of B.C. today. And that decision was for the B.C. Greens to work with the B.C. NDP to provide a stable minority government over the four-year term of this next session."

They called it a "historic" moment for B.C. Green Party Leader Andrew Weaver and NDP Leader John Horgan agree to work together. <a href="https://twitter.com/hashtag/bcpoli?src=hash">#bcpoli</a> <a href="https://t.co/Dawj370Zyn">pic.twitter.com/Dawj370Zyn</a> —@cbcnewsbc

Details of agreement to come

The deal gives the NDP the support of 44 MLAs — their 41 members plus the three Green MLAs — the minimum number required to have a majority of support in the 87-seat legislature. The Liberals have 43 seats.

The Greens and NDP said the agreement was a "Confidence and Supply Agreement," meaning a guarantee of support for any budgets or confidence motions. But additional details on what the NDP has agreed to in exchange for the Greens' support won't be released until the NDP caucus approves the deal on Tuesday.

"We're going to put the agreement before our caucus and have it ratified, and make it available to the public at that time," Horgan said.

There were many issues the two parties agreed upon during the campaign, including working to stop the Kinder Morgan pipeline and banning corporate and union donations.

But it's unclear what will happen with those issues they disagreed on, including whether electoral reform needs approval in a referendum or just the legislature, or whether the $8.8-billion Site C hydroelectric dam project should be scrapped or merely sent for review.

"We specifically did not ask for there to be a coalition," Weaver said. "We wanted to maintain a minority situation to show British Columbians that [it] can work."

Horgan said after 12 years as an opposition member, he's "excited by the prospect of working with opposition members to make B.C. better."

During today's <a href="https://twitter.com/hashtag/bcpoli?src=hash">#bcpoli</a> conference, Weaver and Horgan were asked if either had called Liberal Leader Christy Clark beforehand. The response: <a href="https://t.co/qSblAQjy6X">pic.twitter.com/qSblAQjy6X</a> —@cbcnewsbc

What comes next?

Under Canada's political system, B.C. Liberal Leader Christy Clark remains premier for the time being. She can now ask Lt.-Gov. Judith Guichon for the chance to face the legislature and introduce a throne speech, resign or request to dissolve the legislature and hold another election.

Horgan and Weaver are optimistic Guichon will see their agreement as strong enough to give the NDP the opportunity to form government without an election.

​"We have the majority of support in the legislature. We'll be making that known to the lieutenant-governor in the next couple of days, and we'll proceed from there," Horgan said.

Clark didn't take part in the negotiations between her party and the Greens. A short time after Weaver and Horgan made their announcement, she issued a statement saying she would have more to say on Tuesday.

"In recent days, we have made every effort to reach a governing agreement, while standing firm on our core beliefs. It's vitally important that British Columbians see the specific details of the agreement announced today by the BC NDP and Green Party leaders, which could have far-reaching consequences for our province's future," she wrote.

"As the incumbent government, and the party with the most seats in the legislature, we have a responsibility to carefully consider our next steps."

CBC's legislative reporter Richard Zussman breaks down the likely scenarios. 2:42 Hamish Telford, a professor of political science at the University of the Fraser Valley, said Clark still has options but her chances of remaining premier for any length of time are dim.

"Does she throw in the towel now? Does she go to the lieutenant-governor and say, 'It's clear I'm not going to get the confidence of the legislature, I'm out'? I really don't think that's going to be the case," he said.

"All it's going to take is maybe one Green member or one NDP member to be sick and not make the [first budget] vote for [an NDP] government to survive. This is a very precarious situation."

But on Monday evening, it appeared to be a precarious situation firmly in the NDP's favour.

"The premier," Horgan said, "will have some choices to make, without any doubt."

WATCH: The full NDP-Green press conference

The leaders made the joint announcement Monday afternoon at the B.C. Legislature, saying they had reached a four-year agreement. 20:28

With files from Lisa Johnson