A Naval engineer was charged Friday with trying to leak drawings of the military’s new aircraft carrier to the Egyptian government, not knowing that he was dealing with an undercover FBI agent.

Federal authorities alleged in court filings that Mostafa Ahmed Awwad, 35, of Yorktown, Va., gave computer drawings of the USS Gerald R. Ford to an agent posing as an Egyptian intelligence officer and talked about where to shoot the vessel to sink it. He was charged with attempted exportation of defense articles and technical data and was ordered held after an initial appearance Friday in federal district court in Norfolk.

Awwad’s alleged plot was a startling one, potentially threatening the security of a carrier that officials have hailed as a technological marvel. The ship — which will weigh 100,000 tons and hold 4,660 staffers and 75 aircraft — is expected to cost $13 billion to complete. It is being built in Virginia.

Authorities alleged in court filings that Awwad, a civilian who worked in the Nuclear Engineering and Planning Department at the Norfolk Naval Shipyard, had a secret clearance and that some of the materials he provided to the undercover agent were not supposed to be released to non-U.S. citizens, or contained technical data that was subject to U.S. export laws. The court filings stated that Awwad was born in Saudi Arabia but had married a U.S. citizen in Cairo in 2007 and went about becoming a U.S. citizen then.

It is unclear why authorities first became concerned with Awwad, but in September, an undercover agent speaking in Arabic and identifying himself as “Yousef” from Washington, D.C., called the engineer and asked to meet at a park in Hampton, Va., according to a search warrant affidavit.

Awwad, who had been working at the Norfolk shipyard since February and had the secret clearance for only about a month, agreed to meet without asking for any more information, authorities alleged in the affidavit.

The events that transpired in the following months seem drawn from the pages of a spy novel. Awwad told the agent he wanted to use his Navy position to help give military technology to Egypt, according to the affidavit. The pair met at the Sandy Bottom Nature Park in Hampton, Va., and used a dead-drop location — a secret hole in the ground off a secluded hiking trail where each could leave materials for the other to find — to avoid law enforcement detection, according to the affidavit.

They also exchanged pay-as-you-go phones and agreed to code their ­e-mails. Awwad, for example, used the pseudonym “Cathy Jean” and the subject line “Sick” to indicate a problem, according to the affidavit. At one meeting, Awwad flashed a .45-caliber handgun, according to the affidavit.

Awwad described to the agent a plan he had to bug his computer so that he could copy restricted materials without drawing attention, according to the affidavit. But authorities allege he also used more old-fashioned methods. At one point, he asked the agent for money to buy a pinhole camera, and he was spotted in his office at the shipyard using what appeared to be a pocket camera to take photos of an aircraft carrier’s design schematics, according to the affidavit.

The affidavit describes at least 10 drawings of the USS Ford that Awwad gave to the undercover agent.

A spokeswoman for Huntington Ingalls Industries, which is building the USS Ford, declined to comment for this story, referring inquiries to the Navy. A spokesman for the Norfolk Naval Shipyard said he was unable to comment immediately, and another Navy spokesman did not immediately respond to a message seeking comment.

No lawyer was listed for Awwad in court records, and relatives could not immediately be located.