When the tote board went dark after the final race of the day at Aqueduct Racetrack recently, Pat Mahony called it a career, one he has cherished and one that has been part of his family history for more than a century. Like his father and grandfather before him, Mahony is a mutuels man.

By his estimation, during the last 50 years, he has spent 14,000 days at the track, watched more than 130,000 races and been responsible for the more than $20 billion that has come through the betting windows at the racetracks he has supervised from Florida to New York.

Betting may have been the Mahony family business, but it never was the family’s pastime.

“It never interested me or my father and grandfather,” said Mahony, 69, who has headed parimutuel operations at the New York Racing Association for the last 13 years. Instead, the Mahonys stayed busy helping to build the modern parimutuel betting system.

“Parimutuel” is a French term that translates as “to wager among ourselves.” Unlike most forms of gambling, in a parimutuel system, the odds are not fixed by a bookie or a house. Instead, bettors are pitted against one another.

In building this system, the Mahonys were eyewitnesses to some of the greatest milestones in American thoroughbred history.

Mahony’s grandfather Mort ran the betting at Pimlico and managed the money for the Seabiscuit-War Admiral match race there in 1938. He also supervised the pools for the first six Triple Crown winners, beginning with Sir Barton in 1919.

Mahony’s father, Riggs, was in charge in Baltimore for the second leg when Assault (1946) and Citation (1948) swept the series. And Pat Mahony was in command of the betting at Belmont Park in June when American Pharoah became just the 12th horse to take down the sport’s holy grail.

It was a fitting way to send off the Mahonys after 111 consecutive years of tending to the betting pools at some of the nation’s greatest racetracks.

“We managed the money at 11 of the 36 Triple Crown champion races,” Mahony said. “We were in the betting rings year in, year out through world wars and the Depression. That is something to be proud of.”

Mahony may be walking away from a job, but he is not turning his back on his life’s work. The rich history of gambling on horses in America is Mahony’s passion, and during the last decade, he has spent countless hours in the archives tracing its origins. He has collected hundreds of pages and bound them in a brief called “Key Names in the History of Organized Betting on Horseracing in America.”

It is peopled by larger-than-life characters like Dr. Robert Underwood, a veterinarian born and raised in Dublin who found a home in Lexington, Kentucky, and is considered the founding father of modern bookies. Doc Underwood, as all gamblers knew him, sold his first pool in 1855 in New Orleans on a match race between the horses Lexington and LeCompte and later ran a betting operation out of the basement of the United States Hotel in Saratoga Springs, New York.

James E. Kelly is a particular favorite of Mahony’s. In the late 1800s, his firm, Kelly and Bliss, ran betting halls in Manhattan and was the chief bookmaker at New York tracks like Morris Park and Sheepshead Bay.

When Kelly was called before a legislative committee investigating him and his colleagues, he gave his occupation as “speculator” and looked every bit the financial magnate until he started talking about his Coney Island gambling ties.

He also was a friend and associate of Leonard Jerome, one of the first flamboyant financiers bestowed the title the King of Wall Street. (It’s hard not to like a man who was prepared to defend The New York Times Building with a Gatling gun, as Jerome was during the draft riots of 1863.)

Jerome had traveled to Paris and admired the parimutuel machine that was a staple at racetracks in France. He ordered two for the track that he owned and that carried his name, Jerome Park. When they did not arrive in time for opening day, he dictated specs by memory to a carpenter who was able to build two working machines.

“In the ring on opening day, Kelly worked one machine, but he was so busy that Jerome had to jump in and help him out,” Mahony said. “Think about that — Kelly was the first person to sell a mutuel ticket in America, and Leonard Jerome, Winston Churchill’s maternal grandfather, was the second.”

Even better, Mahony can trace his family’s ties to the mutuel industry to that exact moment. Kelly was the first to give John Cavanagh a job in the betting ring and helped groom Irish John, as he was known, into becoming the czar of the New York betting rings into the early part of the 20th century. It was Cavanagh who plucked a young Mortimer Mahony from the ranks of Wall Street, where he ran bets for some of its titans.

“At some point in 1905, Cavanagh saw him and apparently was impressed enough to offer him a job in the ring working for him,” Mahony said. “He later became his assistant, running betting rings in Maryland, and ended up supervising betting at every track east of Kentucky.”

When Mort died in 1949, Riggs Mahony was already a 23-year veteran in the mutuels industry and plied his craft in New Jersey and Florida. He brought Pat Mahony into the money room and the family business in 1966.

“I never wanted to do anything else,” he said.

Mahony still doesn’t. Once a mutuels man, always one.

He intends to continue his research into the history of his profession and to lobby some of the rich and powerful in the sport for some recognition of his life’s work.

“The National Museum of Racing and Hall of Fame has wonderful exhibits about the owners and the horses and the people who ride and train them,” he said. “But what about the gamblers and bookmakers and technology they have brought? There’s not much. I’m going to try to change that. If there was no gambling, there would be no sport.”