For six years, Mayor Rahm Emanuel has kept his notoriously foul mouth pretty much in check with the exception of a profanity-laced tirade against Chicago Teachers Union Karen Lewis that occurred before Emanuel took office.

That apparently ended with the heated debate over how to spend $17 million left after a property tax rebate for which only 25,300 of the 155,000 eligible Chicago homeowners bothered to apply. On Thursday, rookie Ald. Ray Lopez (15th) accused the mayor of dropping the F-bomb during a heated discussion behind the City Council chambers last month.

Emanuel was apparently livid that Lopez was continuing to insist that “every penny” left unclaimed from the rebate — as well as a $20 million settlement from the Arizona company that operated Chicago’s red-light camera program — be earmarked for violence prevention in neighborhoods that have “turned into war zones.”

“He didn’t tell me to f— off. He just said, ‘Why am I f—ing with him?’. . . I don’t think he was anticipating me coming up with my own ordinance to try and spend the money differently,” Lopez said Thursday after joining community leaders for another City Hall news conference to push the issue.

Lopez said he responded to the mayor by using similar language.

“I said, ‘I’m not f—ing with you. I’ve got people dying in the street. What do you want me to do?” the alderman said.

“I told him that I cannot take his program to the neighborhood without people thinking that I’m joking. . . . To try and convince my residents that things like fighting cyberterrorism are important when they’re dodging real bullets? Fixing sidewalks or rehabbing 20 homes instead of getting right to the heart of what the violence was? It came off like a cruel joke.”

He represents the gang-ridden West Englewood community, where 12-year-old Kanari Gentry-Bowers was killed. She was struck by a stray bullet Saturday while playing at her school playground, one of three children this week caught in the crossfire between rival gangs.

Emanuel’s press secretary Matt McGrath was asked whether Emanuel used profanity with Lopez and whether such language is appropriate in dealing with an alderman.

McGrath said Emanuel “doesn’t recall the conversation, although he doesn’t deny a flair for colorful language either.”

“Regardless, whatever was said didn’t stop the alderman from reaching out as recently as Monday night to discuss issues in his ward and asking for help – and the mayor remains committed to working with each alderman to address our public safety challenges in a comprehensive way,” McGrath wrote.

McGrath went on to defend the mayor’s plan to spend the unclaimed rebate money.

“Everyone agrees that investing in improving public safety is a top priority. That’s why our proposal for the unused rebate dollars includes funding to build and operate strategic nerve center in police districts – including one in Ald. Lopez’s police districts,” McGrath wrote.

“That’s why the proposal includes funding for anti-violence efforts like afterschool programs for our youth. And that’s why we added tens of millions of new dollars for public safety, youth summer jobs, and mentoring in the most recent city budget. We will continue working with anyone to advance these priorities.”

Emanuel has asked the City Council to give after-the-fact approval to his plan to spend the $17 million in unclaimed rebate money.

Some of the mayor’s chosen projects were already announced, such as speeding up distribution of body cameras to Chicago Police officers, providing cybersecurity training at City Colleges, renovating vacant homes in depressed neighborhoods, and providing legal assistance for immigrants threatened with deportation.

A budget amendment expected to be considered by the Budget Committee on Tuesday also includes $1.1 million for “crime-fighting intel centers” in the 7th and 11th police districts; $500,000 to plant 1,000 trees, 20 in each of the 50 wards; $1.8 million to support afterschool athletics programs for Chicago Public Schools students “and other afterschool programs” that operate in public schools; $3.5 million for “park infrastructure improvements”; $1 million to create a small-business incubator on the West Side and $1 million toward a South Side call center “to create jobs and training opportunities.”

On Thursday, Lopez argued that the list is evidence of the mayor’s misplaced priorities.

“We’re spreading ourselves too thin, going for too many headlines and not necessarily having the needed impact that our neighborhood demand,” Lopez said.

“If we can spend $6 million towards expanding One Summer Chicago to be a One Year Chicago where we have opportunities for youth all year round, that will go far and beyond what we’re seeing in some of the proposals [Emanuel] has put forth. The trees? The parks? They’re all great. But right now is not the time to try and invest in parks when my kids can’t even walk from one end of the block to the other.”

In addition to bankrolling a year-round jobs program, Lopez wants to earmark $5 million to expand to 3,000 fifth- and sixth-graders school-based counseling and case management programs with a proven track record for reducing school-based disciplinary incidents and repeat arrests.

And he wants to spend $5 million more to provide mentoring to an additional 2,175 at-risk men and women. That’s in addition to Emanuel’s three-year, $36 million mentoring program.

Molly Poppe, a spokesperson for the city’s Office of Budget and Management, said the administration has been in discussions with Lopez and those talks would continue. Lopez said separately that Emanuel is searching outside sources of money to fund Operation CeaseFire for street intervention aimed at preventing crime.