Rep.-elect Alexandria Ocasio-Cortez (D-N.Y.) arrives for orientation for new members of Congress on Nov. 13 in Washington. (Pablo Martinez Monsivais/AP)

Rep.-elect Alexandria Ocasio-Cortez (D-N.Y.) rallied a group of climate-change demonstrators waging a sit-in in Minority Leader Nancy Pelosi’s (D-Calif.) office Tuesday, an encounter that touched off a display of mutual admiration between the 78-year-old matriarch and the millennial upstart.

Ocasio-Cortez, the self-described democratic socialist who ousted veteran Rep. Joseph Crowley (D-N.Y.) this year, struck a less-confrontational tone in the Capitol than she has on the campaign trail, openly raising the possibility of cooperating with Pelosi should she return to her perch as House speaker in the new Congress.

“Should Leader Pelosi become the next speaker of the House, we need to tell her that we’ve got her back in showing and pursuing the most progressive energy agenda that this country has ever seen,” Ocasio-Cortez said, according to a video posted on Twitter by the environmental group Sunrise Movement, which organized the protest.

By Tuesday afternoon, what at first seemed like a potentially angry encounter as Pelosi seeks to secure the speakership, instead took a friendly turn, with the longtime Democratic leader and the 29-year-old liberal insurgent exchanging public messages of support.

“Deeply inspired by the young activists & advocates leading the way on confronting climate change,” Pelosi said in a tweet. “The climate crisis threatens the futures of communities nationwide, and I strongly support reinstating the select committee to address the crisis.”

In a separate statement, Pelosi said she welcomed the activists and urged the Capitol Police to “allow them to continue to organize and participate in our democracy.”

“I have recommended to my House Democratic colleagues that we reinstate the select committee to address the climate crisis,” she said. Pelosi had told the New York Times in an interview two weeks ago that she would ask House Democrats to reinstate the panel.

Ocasio-Cortez responded Tuesday afternoon: “Thank you, @NancyPelosi. We have 10 years left to plan and implement a Green New Deal before cataclysmic climate disaster. Reinstating the Select Committee is exactly what we need to do.”

In an exchange with reporters at the Capitol, the newly elected lawmaker also said that “one of the things I admire so much about Leader Pelosi is that she comes from a space of activism and organizing,” according to footage posted by the Washington Examiner.

Pelosi has yet to secure enough votes among her caucus to ensure that she will be reelected as speaker when the new Congress convenes Jan. 3. But the longtime Democratic leader is working aggressively behind the scenes to rally members behind her bid, with the first test of her support likely to come Wednesday, when Democrats will debate a change to party rules.

The environmental activists are calling for a “Green New Deal” that would create jobs and address the climate crisis.

Varshini Prakash, founder of Sunrise Movement, criticized Pelosi in a statement Tuesday, saying that her climate change plan “is the equivalent of bringing a squirt gun to a raging drought-induced wildfire killing Americans right now.”

But Ocasio-Cortez took a more evenhanded approach, encouraging those at the sit-in and calling for “100 percent renewable energy in 10 years” while also refraining from criticizing Pelosi directly. As the demonstrators greeted her with wild applause and cheers, she told them that their protest was “not just about confrontation” but also about “real, meaningful unity.”

“I just want to let you all know how proud I am of each and every single one of you for putting yourselves and your bodies and everything on the line to make sure that we save our planet, our generation and our future,” Ocasio-Cortez said. “It’s so incredibly important.”