PHILADELPHIA — Hillary Clinton capped the final night of her historic bid to become the nation’s first female president with a rally late Monday at Independence Hall, presenting a united front alongside Barack and Michelle Obama ahead of what she hopes will be a Democratic changing of the guard.

Clinton thanked the president and first lady for their eight years of service.

“Like them, I love America and I know you do, too. We love this country,” the Democratic nominee said. “We love what it stands for — not that we are blind to its flaws, its problems, its challenges — but I believe with all my heart that America’s best days are still ahead of us, if we reach for them together.”

Clinton and others who took the stage urged her supporters to the polls. “Every issue you care about is at stake,” she said.

Clinton wrapped up her campaign with a midnight rally in Raleigh, North Carolina, before returning home to Westchester County, where she will cast her ballot Tuesday and have an election night party under a glass ceiling at Manhattan’s Jacob K. Javits Convention Center.

In the City of Brotherly Love with her husband, former President Bill Clinton, and their daughter, Chelsea Clinton, in attendance, Hillary Clinton sought to turn the corner on what has been a vitriolic campaign, its last weeks marred by leaked audio in which Donald Trump says he can grab any woman he wants and renewed controversy over her use of a private email server while secretary of state.

advertisement | advertise on newsday

“I regret deeply how angry the tone of the campaign became.”

She reminded her supporters that even with an Election Day victory, the difficult task ahead would be to unite a nation fractured by the deeply divisive race.

More than 33,000 people came to the concert she hosted with Bruce Springsteen and Jon Bon Jovi, according to the Clinton campaign.

Springsteen said of Trump mid-set: “This is a man whose vision is limited to little beyond himself.”

First lady Michelle Obama also spoke against the Republican nominee, saying, “We deserve a leader who will ensure that our daughters are safe and respected and that our sons understand that truly strong men are compassionate and kind.”

“She will work and she will deliver. She won’t just tweet,” President Barack Obama said of Clinton, with a reference to Trump’s favorite social media tool.

Clinton has told voters again and again that helping her on her path to 270 electoral votes equals setting the country on the path to healing.

“Tomorrow, you can vote for a hopeful, inclusive, big-hearted America,” she said in Pittsburgh, her first of four scheduled stops Monday.

Later in Allendale, Michigan, she added, “After tomorrow, the work will begin. And one of the highest priorities that I feel an obligation to address is how we bring the country together.”

Pennsylvania and Michigan are two traditionally blue states that Clinton and her team are battling to defend against Trump. Polls of voters show her with a slight edge, but Trump’s campaign has predicted victory in those states and held several recent massive rallies there.

advertisement | advertise on newsday

To close out her election eve tour, Clinton held a midnight rally with Lady Gaga, John Legend and Jon Bon Jovi at the North Carolina State University’s arena in Raleigh.

Lady Gaga declared it “one of the most favorite days that I have. . . . I could never fathom in my lifetime a woman could become president.”

Clinton walked out with Bill and Chelsea Clinton and raised arms with Lady Gaga and Bon Jovi.

“Welcome, Election Day,” Chelsea Clinton said.

“I ask you not to quit until the polls closed,” Bill Clinton said.

advertisement | advertise on newsday

Hillary Clinton then embraced her husband, and the crowd erupted into chants of “I believe that she will win.”

“This is sure worth staying up for,” Hillary Clinton said. “It’s a choice between strong steady leadership and a loose cannon.”

The first half of her day was spent speaking to crowds made up mostly of students, stressing that their futures are at stake.

In the shadow of the Gothic Revival-style Cathedral of Learning at the University of Pittsburgh, she said the country’s common mission should be “doing all we can to help every American, especially every young American and every child, to have a chance to live up to your God-given potential.”

Several little girls joined their mothers and grandmothers in the audience.

Stephanie McHenry, 32, brought her daughter, Hazel Batista, 8. The Pittsburgh-based product manager called the election a choice between “inclusivity and exclusivity.”

A Clinton aide touted an extensive and data-driven ground game in Pennsylvania with volunteers knocking on more than 1.3 million doors this past weekend, compared to about 500,000 the previous weekend.

The candidate and her campaign have sought to move past the bombshell announcement on Oct. 28 by FBI Director James Comey that the agency was reviewing newly discovered emails and the surprise update Sunday that the agency had closed the investigation. Comey said the FBI would let stand its July decision, which called her email practices reckless but not criminal.

Trump has blasted Clinton on the email controversy and other instances of what he and his supporters say is her corruption that should have disqualified her as a presidential candidate in the first place.

With David M. Schwartz