A flag of the Islamic State flies in 2014 in Iraq. (JM Lopez/AFP/Getty Images)

Haris Qamar dreamed of joining the Islamic State, even going so far as to purchase a plane ticket to Turkey in 2014, authorities said. But before he could depart, his parents confiscated his passport to keep him from leaving the country.

Thwarted in his initial plan, the 25-year-old from Burke turned his attention to tweeting his support for terrorist attacks, taking photos of local landmarks he thought would be used in a video to encourage attacks, and possibly driving by the homes of U.S. soldiers on an Islamic State “kill list,” according to court documents.

Qamar boasted to an associate of his love for beheadings, blood and bodies, and his ability to keep his activities secret, court files show.

It turns out the associate was a federal informant.

Qamar was arrested Friday morning on federal charges of attempting to provide material support for the Islamic State.

He is the second young man from Northern Virginia to be arrested this week. Both are U.S. citizens. Qamar was born in Brooklyn. Mohamed Jalloh, arrested Sunday, was born in Sierra Leone and lives in Sterling.

The arrests come during a heightened period of attacks by the group overseas and just weeks after last month’s mass shooting in Orlando, during which the gunman pledged his allegiance to the terrorist group.

During a brief appearance in federal court Friday in Alexandria, Qamar spoke only to say that he could not afford his own attorney. Sporting a bushy beard, he wore red gym shorts and a faded black T-shirt that on the back read, “The next big thing is here.”

As he walked out, he looked around the courtroom seeming to scan for relatives; none appeared to be there. Family members did not return calls seeking comment.

Qamar first came to the attention of authorities in May 2015 through a series of more than 60 pro-Islamic State Twitter accounts he operated under variations of the name “newerajihadi,” according to court documents.

In September, Qamar was befriended by a confidential informant for the FBI who contacted Qamar through one of his Twitter accounts, according to an affidavit. It says the informant pretended his cousin was an Islamic State fighter and was able to gain Qamar’s trust, eventually filming him saying “Bye-bye, D.C.,” and “Kill ’em all” as they drove around to take pictures of D.C. landmarks.

The affidavit states Qamar also told the informant that he had an “unlimited appetite” for violence against nonbelievers and that he watched brutal videos of Islamic State executions many times. On another occasion, the court filing shows, he asked the informant whether he would like to behead someone using a table saw.

On Twitter, Qamar tweeted a prayer asking Allah to “give strength to the mujahideen to slaughter every single US military officer,” authorities said. He also told the informant that he knew the addresses of several military members on an Islamic State “kill list” released in September. According to the FBI, Qamar lived within a couple of miles of two residences on the list and he probably drove by the locations.

Qamar called Mohamad Khweis, an Islamic State fighter from Alexandria, Va., an idiot for turning himself over to Kurdish forces and being returned to the United States, according to court documents.

Qamar allegedly also told the informant about the plane ticket he purchased to join the Islamic State overseas in 2014. Authorities say records show Qamar did buy such a ticket for July 2014 but never showed up for the flight.

However, in conversations with the FBI informant, Qamar also expressed concern about his family, who strongly opposed the Islamic State, the documents state. He said his father would die of shock if he went abroad to fight with the terrorists, or possibly commit suicide, according to court filings, and said aiding the terrorist group from afar might be “the most we can do.”

In May, at the informant’s encouragement, Qamar drove around the D.C. area taking pictures of landmarks for a purported Islamic State propaganda video encouraging “lone wolf” attacks in the United States. The informant claimed his cousin was helping produce such a video.

Looking around, according to the documents, Qamar told the informant he felt a “burning sensation in my body because this place is so disgusting.”