James P. Kelly, 55, a security specialist and a former investigator for a number of House and Senate committees, died at Arlington Hospital June 26 following a heart attack. He was striken at his home in Arlington.

Mr. Kelly, who was born on Staten Island, N.Y., served in the Navy in the Pacific during World War II. After the war, he returned to Staten Island and joined the New York Police Department, where he became a detective in the Narcotics Bureau. He earned a bachelor's degree from Wagner College in 1952.

In 1957, he resigned from the police department and moved to Washington as an investigator for the Senate Select Committee on Improper Activities in the Labor-Management Field. The committee chairman was the late senator John McClellan (D-Ark.) and its chief counsel was the late Robert F. Kennedy. One of the organizations investigated by the committee was the Teamsters Union and its former president, James R. Hoffa.

In 1959, Mr. Kelly transferred to the House special subcommittee on legislative oversight of the Committee on Interstate and Foreign Commerce. The subcommittee investigated alleged deceptive practices on television and the use of television ratings. It uncovered the cheating on "The $64,000 Question," a popular show of the time.

From 1960 to 1964, Mr. Kelly was a staff investigator on the House special subcommittee on the federal aid highway program, which examined alleged irregularities and the acquisition of rights of way.

For the next two years, Mr. Kelly lived in New York City and was an associate producer for CBS-TV. He then moved to Boston, where he was general manager and associated director of WGBX-TV.

In 1967, he returned to Washington as chief investigator on the House subcommittee on investigations of the Committee on Interstate and Foreign Commerce. From 1971 to 1975, he was a staff investigator on the Senate Commerce Committee.

Mr. Kelly then became a business consultant. In 1977, he became a staff investigator on the House Select Committee on Assassinations, where he was assigned to the John F. Kennedy Task Force.

Since 1979, Mr. Kelly had been director of security audit for Joseph J. Cappucci Associates Inc.

Mr. Kelly's marriage to the former Marion Merewether ended in divorce.

Survivors include his wife, Mary Nash Kelly, and their daughter, Ann Elizabeth, of Arlington; two children by his first marriage, Brian and Cecelia Ann Kelly, both of Medford, Mass., and two brothers, John, of Springfield, N.J., and Richard, of Neptune, N.J.