Harmon Rabb Jr. graduated from the United States Naval Academy at Annapolis, Maryland; and although never stated in canon, judging by his birth year and other dates made explicit, it must have been in the latter half of the 1980s. His service number is #989548301. During his early naval career, Harm was a naval aviator flying F-14 Tomcats. On April 16, 1989, while flying an F-14 Tomcat to enforce a no-fly zone in the Gulf of Sidra, after he and his wingman were attacked, Harm shot down a Libyan Air Force MiG-23, disabled another, and forced the third one to return to its base. He served aboard the aircraft carrier USS Midway at some point. After an accident during a night landing on an aircraft carrier, in which his RIO (Radar Intercept Officer) dies, it is revealed Harm suffers from night blindness, he recovered on his grandmother's farm in Pennsylvania, before returning to naval service. After graduating from law school at Georgetown University Law Center and passing his bar exam, he transferred to the Judge Advocate General's Corps (JAG). During his time at JAG, he trained with Navy SEALs and Marine Force Recon at close-quarters combat, Halo jumps, and other special forces tactics.
One of his most memorable moments was, in his zealous prosecution of a Navy SEAL Chief Petty Officer, he fired an automatic weapon into the courtroom ceiling. Other notable cases Rabb was involved in include going undercover as a Force Recon Gunnery Sergeant, and investigating whether the actions of Navy SEAL Lieutenant Curtis Rivers (Montel Williams) warrants the Medal of Honor.
After a few years as a Judge Advocate, he had laser surgery to correct what was misdiagnosed as night blindness (actually blurred vision as a result of retinal scarring caused by service action) and resumed his career as a naval aviator, flying F-14s off the USS Patrick Henry (CVN-74) as a member of VF-218 "Raptors". However, because of the slim chance of career advancement as an aviator, Harm returned to JAG after six months of service aboard Patrick Henry. While in the aviation squadron, his call sign was "Pappy" because he was older than the other aviators. Later, the other pilots renamed him "Hammer", his father's former call sign, believing Rabb's father would have been impressed by his son's bravery.
In 2002, Harm and Mac prosecutes a high-ranking Al-Qaeda member captured by US Forces in Afghanistan in a military tribunal.
In the season 8 episodes "Ice Queen" and "Meltdown"—the backdoor pilot for NCIS—Rabb is accused of killing Lieutenant Loren Singer (Nanci Chambers). He was defended by Lieutenant Commander Faith Coleman (Alicia Coppola). Though NCIS Special Agent Leroy Jethro Gibbs (Mark Harmon) initially thinks he is the culprit, Gibbs later becomes convinced of his innocence, but it is Special Agent DiNozzo (Michael Weatherly) who finds the proof exonerating him.