Robert J. Giannelli, who rose through the ranks of the New York Police Department to become a chief of patrol, commanding more than 34,000 uniformed officers before his retirement, has died.

Giannelli died Oct. 29 in his Huntington home of a heart attack, family said. He was 67.

During his more than 40-year tenure with the NYPD, Giannelli managed some of the most high-profile cases, including rescue and recovery efforts at Ground Zero after the 9/11 terrorist attacks, the crash of TWA Flight 800 and the hunt for the city's copycat Zodiac killer, his family said.

Giannelli's love of police work was matched only by his dedication to family and his deep Christian faith, relatives said.

"He was an amazing example of what a man should be to his wife, and to his children, and his grandchildren," said Giannelli's daughter, Jennifer Shanahan, 43, of Bohemia.

"My father always taught . . . you put God first, then your family, and then for him it would be the NYPD."

Born in 1947 in the Bronx to Italian immigrant parents, Robert Giannelli graduated from Mount St. Michael Academy in the Bronx in 1964, and later earned a bachelor's degree in criminal justice from SUNY Empire in Saratoga Springs in the 1990s the family said. He joined the police department as a trainee in 1965 and became a sworn officer in 1968.

He met his future wife Tricia Giannelli in 1972 through his first police partner and friend Arthur Nascarella, 69, of Fort Lee, New Jersey.

"Giannelli took one look at her and left me flat," said Nascarella, a retired NYPD detective who acts in film and television shows. "He gave up his mother's meatballs for that girl!"

Tricia Giannelli, 65, of Huntington, said the pair were married within 8 months of meeting and went on to have four children. "My husband loved me like nobody else ever loved me. He was so kind and generous and understanding," she said. "We were soul mates."

Tricia Giannelli said his greatest joy was helping other people -- a trait that extended to taking in a friend's son and coaching his sons' youth soccer teams.Robert H. Giannelli, 40, of Coram, said his father required that his children complete their homework before they could play. "He let us know that there are priorities that you have to have in life."

Giannelli said his father was an avid sports lover who built a soccer goal and pitching mound in the back yard for his children and spent his retirement running and exercising."His heart was at home with his family," said Giannelli, adding that he will miss his father's entertaining stories and advice. "He would talk with you . . . he wouldn't talk at you."

Giannelli did not keep his police work separate from his family, they said. "If we were going to know him, we would need to know what his day was like," said Tricia Giannelli.

Giannelli was promoted to sergeant in 1974, lieutenant in 1984, captain in 1985, deputy inspector in 1992, full inspector in 1997, deputy chief in 2002, assistant chief in 2003 and chief of patrol in 2007 before his retirement in 2010, family said.

Nascarella recalled Giannelli helping him through post-traumatic stress syndrome from 9/11 rescue efforts by taking him around in a radio car as the pair did as rookies the 23rd precinct, supervised by former NYPD commissioner Raymond Kelly."Men would follow him into a burning building," Nascarella said. "He had enough courage to give it away."

Giannelli is also survived by his son Jacob A. Giannelli, 37, of Central Islip; daughter Sarah Giannelli, 36, of Brooklyn; and two grandchildren. He was preceded in death by his brother James Giannelli.

A wake will be held Tuesday 2-4 p.m. and 7-9 p.m. at M.A. Connell Funeral Home in Huntington Station, with a full inspector's funeral Wednesday at 10 a.m. at Northport Rural Cemetery in Northport.

Donations can be made to Smithtown Gospel Tabernacle missionary fund and to the NYPD widows and orphans fund.