President Obama defended his campaign’s attacks on Mitt Romney’s record as a private-equity executive at Bain Capital, telling reporters Monday that Romney’s history is fair game. The president’s remarks came in the face of criticism, some from within his own party, that the attacks were inappropriate.

“My view of private equity is that it is set up to maximize profits, and that’s a healthy part of the free market,” Obama said. But, he added, “that’s not always going to be good for businesses or communities or workers.”

Romney — the likely Republican presidential nominee — and Bain Capital responded forcefully to the attacks, but it was questions from Democrats that complicated the debate for Obama. Those complications began Sunday when Newark Mayor Cory Booker, a close ally of the president, criticized the Obama campaign for targeting Bain in its ads. Booker equated those attacks with ones using statements by former Obama pastor Jeremiah A. Wright Jr. against the president. Booker decried both as “nauseating.”

On Monday, the Romney campaign put out an ad featuring Booker and Democratic former congressman Harold Ford Jr., who agrees with Booker’s statements.

Previously, one of Obama’s former advisers, Steven Rattner, called the president’s attacks on Romney’s private-equity career “unfair.” He added in an interview with MSNBC that “Mitt Romney made a mistake ever talking about the fact that he created jobs,” because the purpose of private-equity firms such as Bain is to create wealth, not jobs. Rattner was “car czar” for Obama early in the administration and has been a Wall Street financier.

Booker and Ford have long ties to Wall Street and the world of private equity, which has a history of supporting Democrats. Bain executives, for example, gave generously to Obama in the past.

This year, the firm’s executives, and the financial industry in general, are strongly supporting Romney. But during the 2008 election cycle, employees of Bain Capital and Bain & Co. donated $1.47 million to federal candidates, parties and political committees, with two-thirds of that money going to Democrats, according to the Center for Responsive Politics. During that cycle, the Democratic National Committee collected $215,000 from Bain-related sources, and its GOP counterpart collected $61,650, the center found.

The debate suggests that a big focus of the presidential race will be competing definitions of capitalism, including criticism by Democrats of some of private equity’s most lucrative and controversial practices.

At a news conference Monday after a NATO summit in Chicago, Obama was asked about the criticism from Booker, a close ally.

“This is part of the debate that we’re going to be having in this election campaign,” he said, “about how do we create an economy where everybody from top to bottom, folks on Wall Street and folks on Main Street, have a shot at success.”

Speaking Sunday on NBC’s “Meet the Press,” Booker said, “I have to just say from a very personal level, I’m not about to sit here and indict private equity.”

And although he later backed away from the remarks, calling Bain “fair game” for the president, the Romney campaign pounced. The Republican National Committee also highlighted the issue with an online petition titled “I Stand With Cory.”

Talking to reporters, Obama said he is making Bain an issue because Romney’s “main calling card for why he thinks he should be president is his business experience. . . . When you’re president, as opposed to the head of a private-equity firm, then your job is not simply to maximize profits. Your job is to figure out how everybody in the country has a fair shot. Your job is to think about those workers who get laid off, and how are we paying for their retraining. Your job is to think about how those communities can start creating new clusters so that they can attract new businesses.”

Executives at Bain and companies like it say they are in business to make money, not to create jobs. Some Democrats openly worry that the criticism of Bain could alienate important donors in private-equity hedge funds and traditional Wall Street firms.

However, a Silicon Valley bundler for the president, Wade Randlett, said Monday that Obama’s attacks on Bain will help more than they will hurt. “People forget that for every Wall Street financier who would cross over to Romney [because of the attacks], there are two tech execs who are furious about being lumped in with them as a ‘one-percenter’ ” and will support Obama, said Randlett, who said he does not speak for the campaign.

If the president takes on the private-equity industry, he could rally public anger against Wall Street’s unpopular practices and some of its most lucrative non-banking industries. On the other hand, his attacks could be perceived as targeting capitalism itself. U.S. Chamber of Commerce President Thomas J. Donohue said that Obama’s approach reveals “a failure to understand the role” that private-equity companies play in resuscitating other firms and strengthening the economy.

Democrats have long relied on Wall Street donations for support, which has influenced the party’s approach to economic, regulatory and tax issues. That support has been particularly important for the financial industry’s most outspoken defenders, including Booker and Ford, both of whom have expressed interest in running for statewide office.

The Newark mayor, for example, has courted support from hedge fund and private-equity donors, according to people familiar with his effort. They have supported Booker’s electoral campaigns and aided his efforts to promote school reform. In recent years, Booker sought to raise $100 million to match a grant from Facebook chief Mark Zuckerberg to remake Newark’s schools.

The mayor relied, for example, on William Ackman, founder of Pershing Square Capital Management, and his wife, who pledged $25 million to the schools cause, according to a report in the Chronicle of Philanthropy.

Booker declined a request for comment Monday afternoon. A spokeswoman, Anne Torres, said any claim that he is beholden to private-equity benefactors is ridiculous.

Booker wrote on Twitter that “I will fight hard for Obama to win. But just as his 08 campaign did, I believe we must elevate & not denigrate.”

While previous attacks on Romney’s time at Bain have produced controversy, they have proved effective. Romney was making headway against Sen. Edward M. Kennedy in his 1994 Senate bid, but his campaign faltered as Kennedy attacked Bain’s record of job loss at certain unionized companies.