A Massachusetts man was arrested on Thursday after a letter with white powder was sent to Donald Trump Jr.’s New York City apartment early last month, federal authorities said.

Daniel Frisiello, of Beverly, was taken into custody just before 8 a.m. while he was heading to work, federal authorities said. Frisiello is expected to appear in federal court in Worcester later in the day. Authorities were able to track down Frisiello by analyzing a “glitter bomb” letter — a prank where envelopes are filled with glitter — sent to Stanford University law professor Michele Dauber. Investigators matched the text font in the “glitter bomb” threat to those seen on the letters of the white-powder envelopes.

"These kinds of hoaxes may not cause physical harm, but they scare the heck out of people," said Andrew Lelling, U.S. Attorney for Massachusetts.

Frisiello is accused of sending a total of five letters filled with white powder. Authorities said he sent them to Trump Jr. and Dauber, as well as the office of Sen. Debbie Stabenow, of Michigan; Nicola Hanna, the interim U.S. Attorney for the Central District of California; and actor Antonio Sabato Jr., who is running for a U.S. House seat in California as a Republican.

Frisiello faces charges of mailing threat to injure the person of another and false information and hoaxes.

Trump Jr.’s wife, Vanessa Trump, opened the letter in the couple’s Manhattan apartment on Feb. 12 and reported feeling nauseous and coughing. President Trump’s daughter-in-law and two other people were taken to the hospital in the incident.

The letter was postmarked in Boston on Feb. 7, had an American flag stamp and no return address. The powder was ultimately determined to be cornstarch, The Associated Press reported.

LETTER WITH WHITE POWDER FOR TRUMP JR. CALLS HIM 'AWFUL,' SAYS HE'LL GET WHAT HE 'DESERVES'

Authorities later revealed the letter included a threatening note that read: “You are an awful, awful person. I am surprised that your father lets you speak on TV. You the family idiot. Eric looks smart."

"This is the reason why people hate you. You are getting what you deserve. So shut the F--- UP,” the letter continued.

Frisiello also shared a news report of Vanessa Trump being hospitalized on his Facebook page the day it occurred, federal authorities said.

The president’s son later tweeted about the “scary situation,” saying it was “truly disgusting that certain individuals choose to express their opposing views with such disturbing behavior.”

Like the one Trump Jr.’s wife received, each enveloped contained a different threatening letter addressed to the individual.

A courthouse mailroom employee opened the letter addressed to Hanna that stated: “That’s for murdering Mark Salling! I Hope you end up the same place as Salling.”

The Associated Press contributed to this report.