WASHINGTON — With socialist Sen. Bernie Sanders gaining in polls, Hillary Rodham Clinton Wednesday tilted left again and came out against the 12-nation Trans-Pacific Partnership, which is central to President Obama’s strategic pivot to Asia.

“As of today, I am not in favor of what I have learned about it,” Clinton said on PBS’s “NewsHour.”

The pact, agreed to Monday by the United States and 11 other Pacific Rim nations, sets trade rules for 40 percent of the world’s economy.

Sanders had earlier described it as “disastrous” for American consumers and job creation.

Another Democratic rival, former Maryland Gov. Martin O’Malley, reminded Clinton that she once supported the agreement.

“Secretary Clinton can justify her own reversal of opinion on this. I didn’t have one opinion eight months ago and switch that opinion on the eve of a debate,” said O’Malley, referring to the Democratic debate next Tuesday in Las Vegas.