Democrats are expressing outrage that U.S. border agents on Sunday shot rounds of tear gas at caravan migrants who threw rocks at law enforcement while trying to breach the U.S.-Mexico border. But critics hammering the Trump administration are glossing over a similar episode that occurred under then-President Barack Obama.

In 2013, during the Obama administration, Border Patrol agents reportedly used pepper spray to fend off a group of approximately 100 migrants who attempted to rush the same San Ysidro port of entry.

A San Diego Union-Tribune article at the time said agents fired "pepper balls" and used other “intermediate use-of-force devices” to repel the crowd. The migrants in that confrontation also reportedly threw rocks and bottles at U.S. authorities.

But with the national spotlight on Sunday's caravan clash at San Ysidro, Democrats are lashing out at the Trump administration.

TRUMP TELLS MEXICO TO SHIP MIGRANTS HOME OR SEE BORDER PERMANENTLY CLOSED

In a tweet directed at the president on Monday, New York Democratic Rep. Carolyn Maloney said, “Migrants at our border are looking for help. Yet, instead of greeting them w understanding, you deploy tear gas. Shameful & disgusting.”

New York Democratic Sen. Kirsten Gillibrand called the use of tear gas “horrendous.”

“We must hold those responsible accountable,” Gillibrand tweeted. “Children who approach our country looking for asylum should be welcomed with open arms, not with tear gas.”

Ben Rhodes, the former Obama administration adviser, tweeted: “It’s wrong to gas women and children and the elderly. That shouldn’t be a partisan view nor should that be uncomfortable to ‘the men and women in duty.’”

Rhodes, in particular, faced online pushback over his comments from conservatives, who referenced the 2013 episode during the Obama years.

“Ben Rhodes was part of an administration that did the very same exact thing,” conservative commentator Stephen Miller said.

The Trump administration, meanwhile, defended the response on Sunday. Homeland Security Secretary Kirstjen Nielsen said in a statement some migrants "attempted to breach legacy fence infrastructure along the border and sought to harm [U.S. Customs and Border Protection] personnel by throwing projectiles at them.”

The criticism from Democrats follows other examples of liberals blasting Trump for things that also happened in prior administrations, including sending troops to the border, as Obama did in 2010.

In May, liberal activists and journalists also incorrectly shared pictures of children sleeping in enclosed cages from 2014 to take a swipe at the Trump administration and its zero-tolerance policy toward parents and children crossing the border illegally. Those photos were taken during the Obama administration.

The latest confrontation with caravan members has captured lawmakers' attention. The clash Sunday came as hundreds of migrants from a caravan that originated in Central American pushed past Mexican riot police and rushed the border at the port of entry in San Ysidro.

HUNDREDS OF MIGRANTS TRY RUSHING TOWARD CALIFORNIA PORT OF ENTRY, AS TRUMP THREATENS TO CLOSE ENTIRE BORDER

On Monday, Trump offered Mexico some advice on deporting migrants massed in Tijuana and threatening to storm the U.S., telling the neighboring nation in a tweet to send them “back to their countries” by plane or by bus – or face a permanent closure of the border.

HOMELAND SECURITY ARRESTS ABOUT 50 MIGRANTS WHO CROSSED US BORDER, OFFICIAL SAYS

Trump’s tweet followed a vow from Mexico to deport migrants who tried to illegally enter the U.S. The Trump administration has said asylum claims from members of a series of caravans originating in Central America must be processed outside the U.S., and that all those entering illegally will be denied. A federal judge has at least temporarily ruled against the policy, but the administration has taken steps to harden the border.

“Mexico should move the flag waving Migrants, many of whom are stone cold criminals, back to their countries,” Trump tweeted early Monday morning. “Do it by plane, do it by bus, do it anyway you want, but they are NOT coming into the U.S.A. We will close the Border permanently if need be. Congress, fund the WALL!”

Fox News’ Greg Wilson, Greg Norman and Gregg Re contributed to this report.