Walter R. Walsh, a world-class marksman who shot clothespins off laundry lines as a boy and went on to become an F.B.I. legend in shootouts with gangsters in the 1930s, an Olympic competitor and a trainer of generations of Marine Corps sharpshooters, died on Tuesday at his home in Arlington, Va. He was 106.

His son Walter confirmed the death.

Mr. Walsh was still winning handgun awards and coaching Olympic marksmen at 90, and aside from some hearing and memory loss, he was fit and continued to live alone at home. At the centennial of the Federal Bureau of Investigation in 2008, he was recognized not only as the oldest living former agent, but also as older than the organization itself by more than a year.

He joined the F.B.I. in 1934, a short, feisty James Cagney tough guy fresh out of Rutgers Law School. A natural left-hander, he was already a dead shot who could cut the center of a bull’s-eye at 75 yards with a rifle and blaze away at moving targets with a pistol in each hand — an enormous advantage in a bureau that was just breaking in its first class of agents authorized to carry guns.

“I thought to myself, This might be a good outfit to tie up with,” Mr. Walsh recalled in an NPR interview in 2008. “I am not trying to pin medals on myself, but the people in the F.B.I. knew that I was very handy with firearms.”