Peter Fonda at a premiere in Los Angeles on Tuesday for his new film, “Boundaries.”

The Secret Service is “aware” of a tweet attacking President Trump’s adolescent son that was posted by the actor Peter Fonda, a spokesman for the agency said on Wednesday.

“We should rip Barron Trump from his mother’s arms and put him in a cage with pedophiles,” Mr. Fonda wrote in all caps, referring to the president’s 12-year-old son, in a recent post on Twitter that was later deleted. Mr. Fonda, 78, also wondered if such an act would prompt the first lady Melania Trump to “stand up against” her husband.

The spokesman for the agency said that “as a matter of practice, the Secret Service does not confirm the existence or the status of an investigation.”

In recent days, Mr. Fonda has used Twitter to urge mass protests and to rail against the Trump administration’s “zero tolerance” policy, which has separated immigrant children from parents who crossed illegally into the United States, a practice that drew wide-ranging criticism from both parties, including Mrs. Trump. On Wednesday, Mr. Trump signed an executive order intended to end the separation of families at the border by detaining parents with their children for an indefinite period.

Mr. Fonda’s tweet “is sick and irresponsible,” Stephanie Grisham, a spokeswoman for Mr. Trump, said in an email on Wednesday. She said the tweet had been reported to the Secret Service.

His tweet also drew backlash from some on the right, including the president’s eldest son. Donald Trump Jr. responded to Mr. Fonda in a series of tweets on Wednesday, at one point calling Mr. Fonda a “sick individual,” “bully” and “coward.”

Mr. Trump Jr. also compared Mr. Fonda with Roseanne Barr, the comedian and actress whose racist tweet last month led ABC to cancel…