(Wired) -- A California student got a visit from the U.S. Federal Bureau of Investigation this week after he found a secret GPS tracking device on his car, and a friend posted photos of it online.

The post prompted wide speculation about whether the device was real, whether the young Arab-American was being targeted in a terrorism investigation and what the authorities would do.

It took just 48 hours to find out: The device was real, the student was being secretly tracked and the FBI wanted their expensive device back, the student told Wired.com in an interview Wednesday.

The answer came when half-a-dozen FBI agents and police officers appeared at Yasir Afifi's apartment complex in Santa Clara, California, on Tuesday demanding he return the device.

Afifi, a 20-year-old U.S.-born citizen, cooperated willingly and said he'd done nothing to merit attention from authorities. Comments the agents made during their visit suggested he'd been under FBI surveillance for three to six months.

An FBI spokesman wouldn't acknowledge that the device belonged to the agency or that agents appeared at Afifi's house.

"I can't really tell you much about it, because it's still an ongoing investigation," said spokesman Pete Lee, who works in the agency's San Francisco headquarters.

Afifi, the son of an Islamic-American community leader who died a year ago in Egypt, is one of only a few people known to have found a government-tracking device on their vehicle.

His discovery comes in the wake of a recent ruling by the 9th U.S. Circuit Court of Appeals saying it's legal for law enforcement to secretly place a tracking device on a suspect's car without getting a warrant, even if the car is parked in a private driveway.

Brian Alseth from the American Civil Liberties Union in Washington state contacted Afifi after seeing pictures of the tracking device posted online and told him the ACLU had been waiting for a case like this to challenge the ruling.

"This is the kind of thing we like to throw lawyers at," Afifi said Alseth told him.

"It seems very frightening that the FBI have placed a surveillance-tracking device on the car of a 20-year-old American citizen who has done nothing more than being half-Egyptian," Alseth told Wired.com

Afifi, a business marketing student at Mission College in Santa Clara, discovered the device last Sunday when he took his car to a local garage for an oil change. When a mechanic at Ali's Auto Care raised his Ford Lincoln LS on hydraulic lifts, Afifi saw a wire sticking out near the right rear wheel and exhaust.

Garage owner Mazher Khan confirmed for Wired.com that he also saw it. A closer inspection showed it connected to a battery pack and transmitter, which were attached to the car with a magnet. Khan asked Afifi if he wanted the device removed and when Afifi said yes, Khan pulled it easily from the car's chassis.

"I wouldn't have noticed it if there wasn't a wire sticking out," Afifi said.

Later that day, a friend of Afifi's named Khaled posted pictures of the device at Reddit asking if anyone knew what it was and if it mean the FBI "is after us." (Reddit is owned by CondeNast Digital, which also owns Wired.com).

"My plan was to just put the device on another car or in a lake," Khaled wrote, "but when you come home to 2 stoned off their asses people who are hearing things in the device and convinced its a bomb you just gotta be sure."

A reader quickly identified it as an Orion Guardian ST820 tracking device made by an electronics company called Cobham, which sells the device only to law enforcement.

No one was available at Cobham to answer Wired.com's questions, but a former FBI agent who looked at the pictures confirmed it was a tracking device.

The former agent, who asked not to be named, said the device was an older model of tracking equipment that had long ago been replaced by devices that don't require batteries. Batteries die and need to be replaced if surveillance is ongoing so newer devices are placed in the engine compartment and hardwired to the car's battery so they don't run out of juice. He was surprised this one was so easily found.

"It has to be able to be removed but also stay in place and not be seen," he said. "There's always the possibility that the car will end up at a body shop or auto mechanic, so it has to be hidden well. It's very rare when the guys find them."

He said he was certain that agents who installed it would have obtained a 30-day warrant for its use.

Afifi considered selling the device on Craigslist before the FBI showed up. He was in his apartment Tuesday afternoon when a roommate told him "two sneaky-looking people" were near his car.

Afifi, already heading out for an appointment, encountered a man and woman looking his vehicle outside. The man asked if Afifi knew his registration tag was expired. When Afifi asked if it bothered him, the man just smiled.

Afifi got into his car and headed for the parking lot exit when two SUVs pulled up with flashing lights carrying four police officers in bullet-proof vests.

The agent who initially spoke with Afifi identified himself then as Vincent and told Afifi, "We're here to recover the device you found on your vehicle. It's federal property. It's an expensive piece, and we need it right now."

Afifi asked, "Are you the guys that put it there?" and the agent replied, "Yeah, I put it there." He told Afifi, "We're going to make this much more difficult for you if you don't cooperate."

Afifi retrieved the device from his apartment and handed it over, at which point the agents asked a series of questions -- did he know anyone who traveled to Yemen or was affiliated with overseas training? One of the agents produced a printout of a blog post that Afifi's friend Khaled allegedly wrote a couple of months ago. It had "something to do with a mall or a bomb," Afifi said. He hadn't seen it before and doesn't know the details of what it said. He found it hard to believe Khaled meant anything threatening by the post.

"He's a smart kid and is not affiliated with anything extreme and never says anything stupid like that," Afifi said. "I've known that guy my whole life. "

The agents told Afifi they had other agents outside Khaled's house.

"If you want us to call them off and not talk to him we can do that," Afifi said they told him. "That was weird. ... I didn't really believe anything they were saying."

When he later asked Khaled about the post, his friend recalled "writing something stupid," but said he wasn't involved in any wrongdoing. Khaled declined to discuss the issue with Wired.com.

The female agent, who handed Afifi a card, identified herself as Jennifer Kanaan and said she was Lebanese. She spoke some Arabic to Afifi and through the course of her comments indicated she knew what restaurants he and his girlfriend frequented. She also congratulated him on his new job. Afifi got laid off from his job a couple of days ago, but on the same day was hired as an international sales manager of laptops and computers for Cal Micro in San Jose.

The agents also knew he was planning a short business trip to Dubai in a few weeks. Afifi said he often travels for business and has two teenage brothers in Egypt whom he supports financially. They live with an aunt. His U.S.-born mother, who divorced his father five years ago, lives in Arizona.

Afifi's father, Aladdin Afifi, was a U.S. citizen and former president of the Muslim Community Association here, before his family moved to Egypt in 2003. Yasir Afifi returned to the U.S. alone in 2008, while his father and brothers stayed in Egypt, to further his education he said. He knows he's on a federal watchlist and is regularly taken aside at airports for secondary screening.

Six months ago, a former roommate of his was visited by FBI agents who said they wanted to speak with Afifi. Afifi contacted one agent and was told the agency received an anonymous tip from someone saying he might be a threat to national security. Afifi told the agent he was willing to answer questions if his lawyer approved. But after Afifi's lawyer contacted the agency, he never heard from the feds again until he found their tracking device.

"I don't think they were surprised that I found it," he told Threat Level. "I'm sure they knew when I found it. ... One of the first questions they asked me was if I was at a mechanics shop last Sunday. I said yes, that's where I found this stupid device under my car."

Afifi's attorney, who works for the civil liberties-focused Council on American Islamic Relations, said this kind of tracking is more egregious than the kind her office usually sees.

"The idea that it escalates to this level is unusual," said Zahra Billoo. "We take about one new case each week relating to FBI or law enforcement visits [to clients]. Generally they come to the individual's house or workplace, and there are issues that arise from that."

However, she said that after learning about Afifi's experience, other lawyers in her organization told her they knew of two people in Ohio who also recently discovered tracking devices on their vehicles.

Afifi's encounter with the FBI ended with the agents telling him not to worry.

"We have all the information we needed," they told him. "You don't need to call your lawyer. Don't worry, you're boring. "

They shook his hand and left.

Subscribe to WIRED magazine for less than $1 an issue and get a FREE GIFT! Click here!

Copyright 2011 Wired.com.