Retired Brig. Gen. Ralph B. Lovett, 87, who spent 30 years in the Army and then worked for the Veterans Administration and the Central Intelligence Agency, died Sunday at the Veterans Administration Hospital in Washington. He had suffered a cardiac arrest following a long illness.

Gen. Lovett joined the Army in 1917, during World War I after working for newspapers in Kansas and Oklahoma, where he was born and grew up. He was trained first in codes and ciphers, but most of his career was devoted to administration and public affairs.

During World War II, he had a number of high staff positions, including chief of personnel fo the 8th Air Force in England, ad then adjutant general of the European Theater f Operations with headquarters in London.

He retired from the Army in 1947, and became director of administrative services of the Veteras Administration in Washington. In the same year, he moved to the Philippines to head Veterans Administration operations there.

In the early 1950s, Gen. Lovett joined the CIA and remained in the Philippines until his retirement in 1956, when he moved to Arlington.

His military decorations included the Legion of Merit, the Bronze Star, The Commendation Medal. Commander in the Order of the British Empire, Chevailer in the Order of Leopold of Belgium, the Belgian Croix de Guerre and the French Croix de Guerre.

He was a member of the Army and Navy Club, the Army and Navy County Club, the National Press Club, the Chicago Athletic Club and the Manila Army and Navy Club, of which he was a charter member.

Surviors include his wife. Sally C., of the home in Arlington, a son, C.B. Lovett, of Alexandria, and two grandchildren.