Ms. Lightfoot’s anger with the Texas Republican began after he tweeted in response to a deadly Labor Day weekend for the Windy City: “Gun control doesn’t work. Look at Chicago. Disarming law-abiding citizens isn’t the answer.”

The remark led to a testy back-and-forth between Mr. Cruz and the Democratic mayor, who warned Mr. Cruz to “keep our name out of your mouth” and said the debate between the two is better served via newspaper columns and in-person visits than on Twitter.

“But don’t you dare lecture us with half-truths, cherry-picked statistics and debunked rhetoric designed to score political points with your base and your donors while you, Senate Majority Leader Mitch McConnell (R-Ky.) and the other Republicans in charge of the Senate sit in dereliction of your duty day after day, shooting after shooting,” she wrote.

The mayor reasserted her statistic from their first exchange that 60% of firearms “owned or used illegally recovered in Chicago come from outside Illinois” before inviting Mr. Cruz to Chicago.

“It is our highest priority to rebuild communities that have been harmed for generations by disinvestment, racism and gang violence,” Ms. Lightfoot wrote. “We’re making gradual, but critical, progress.”

Ms. Lightfoot concluded that “the stakes are too high to continue business as usual.”