Mayor Rahm Emanuel on Tuesday chose Anna Valencia as Chicago’s $133,545-a-year city clerk, calling his 31-year-old political operative the “next generation of leadership.”

Valencia, director of the mayor’s Office of Legislative Counsel and Government Affairs, replaces Susana Mendoza, the newly elected state comptroller.

“I’m about promoting another generation of leadership for this city. . . . I’m not threatened by that. I actually want to promote that. As a millennial who happens to be Hispanic, she’s the next generation of leadership,” the mayor said.

“I’m not scared of nominating strong people. . . . Anna is a very strong person who can stand on her own two feet. This will be her first foray from staff to principal,” he said. “So, I told her, if she masters this office and masters politics, she’s part of a new generation of leaders. That is good for the city and good for our civic life.”

Valencia acknowledged that the appointment as city clerk comes with a substantial pay cut.

But she was thrilled to do it. She called it the “American dream” for a downstate daughter of a Mexican immigrant who was the first in her family to graduate from college.

“It’s definitely moving. I called my parents. They were both in tears,” Valencia said Tuesday.

“My dad is a union painter. My mom was a teacher’s assistant,” she said. “I’m going to make them proud.”

Calling Mendoza a “trailblazer for a lot of us,” Valencia said, “This is a natural step to put myself out there. We need more women at the table, especially minority women.”

If Emanuel chooses to seek a third term as mayor, the move paves the way for him to run for re-election on a rainbow ticket with an attractive and articulate Hispanic woman who has earned her stripes as the mayor’s political point person.

In that role, she has helped to tame a rebellious City Council and forged a close working relationship with aldermen she lobbied to approve a utility tax for pensions; controversial ordinances regulating home-sharing and ride-sharing; and overhauling Chicago’s system of police accountability to restore public trust shattered by the police shooting of Laquan McDonald.

“Look at the last two votes: My budget and the Red-Purple modernization. Both were won with 48-0 and 46-0. She’s handled the politics and earned other peoples’ respect in the process,” Emanuel said.

For weeks, aides described the mayor as “torn” between Valencia and Maria Guerra Lapacek, commissioner of the city’s Department of Business Affairs and Consumer Protection.

Emanuel ultimately chose Valencia after she played a pivotal behind-the-scenes role in the mayor’s frenzied campaign to protect illegal immigrants threatened with deportation after the election of President-elect Donald Trump.

“That reminded us why she is such an asset and what a rising star she is,” said a top mayoral aide, who asked to remain anonymous.

The appointment of Valencia also paves the way for her African-American deputy Samantha Fields to take her place. That would appease black aldermen who quietly staked claim to the clerk’s office.

Mendoza had urged the mayor to appoint Deputy Clerk Carina Sanchez to avoid a learning curve in an office Mendoza was so proud to have “transformed.”

On Tuesday, the mayor said his marching orders to Valencia were to “build on” Mendoza’s legacy by speeding up the one-year timetable for implementing the new municipal identification program and by expanding the reach of that new ID.

“While it’s identified with undocumented immigrants, could it be a service for homeless youth and homeless citizens? Could it be a service for ex-offenders? It’s identified in the public domain for one population,” Emanuel said. “But if we’re gonna do this, I actually want it to be a service for people who live in all types of shadows — not one.”

The mayor said he has also asked Valencia to take a fresh look at the Civic Federation’s 2011 recommendation to merge the city clerk’s office with the city comptroller’s office.

“Maybe it’s exactly how it should be. Maybe what should happen is the two get consolidated. Maybe what should happen is certain things today that are in the clerk’s office should be over at the comptroller because they have a better capacity. Take a fresh look and report back in nine months what makes sense. You have an open book to run that process,” Emanuel said.

Valencia’s meteoric rise is a classic Chicago success story.

Three years ago, she was the striking brunette in an Elle Magazine spread on “The Politics of Power Dressing.”

A 28-year-old assistant to Emanuel, she was interviewed and photographed in designer clothing, shoes, handbags and jewelry, hand-picked by the magazine. The story was about what to wear to office meetings, fundraisers and other work-related events.

Now, Valencia is dressing for success on her own dime, with even higher stakes — as Emanuel’s running mate.

A native of downstate Granite City, with a population of roughly 30,000, Valencia is the first member of her close-knit Mexican family to graduate from college.

“My dad . . . said he would sell a kidney or liver so I could go the U. of I.,” Valencia told the Chicago-Sun-Times last spring, though nothing so drastic was required. She got to Champaign-Urbana on a scholarship.

After interviewing for a job she didn’t get on then-U.S. Sen. Barack Obama’s staff, Valencia was connected through a family friend to a job as a campaign organizer for the Virginia Democratic Party.

“I graduated, bought a car, drove to Virginia and canvassed seven days a week in a very, kind of Republican area, where they called me a baby-killer,” Valencia recalled.

“My dad was disappointed. He said, ‘This is a phase. She’ll go to law school.’ I was living in supportive housing and making no money.”

It wasn’t a phase. The same girl who wrote a third-grade essay about wanting to become the first woman president had politics in her blood.

Between Democratic campaigns in Virginia and Michigan, she returned to Illinois to do the same for U.S. Reps. Mike Quigley and Bill Foster, then ran U.S. Sen. Dick Durbin’s 2014 campaign.

She also spent time on the staff of Illinois Senate President John Cullerton, D-Chicago, working closely with Cullerton’s chief of staff and now-state Sen. Andy Manar, D-Bunker Hill, chief sponsor of the bill to rewrite the state school aid formula.

“She’s taken on very difficult and challenging offices and adapted to them, did well at `em. . . . She stepped up in a bigger role with a level of maturity and a level of capability and management,” Emanuel said Tuesday.