William B. Payne, 50, a retired assistant inspector in the Secret Service who served on the White House detail in the Kennedy and Johnson administrations, died Wednesday at Fairfax Hospital. He had cancer.

Mr. Payne was born in Battle Creek, Mich., and grew up in Hastings, Mich. He served in the Army air Force in World War II and was stationed in the Philippines.

After the war, he returned to Michigan and was a retail clerk and a construction worker. He earned a bachelor's degree in police administration at Michigan State University and was appointed a special agent in the Secret Service in 1958.

He worked briefly in the Cleveland field office and then was transferred to Gettysburg, Pa., where he was on the detail assigned to the grandchildren of President Dwight D. Eisenhower.

In 1961, Mr. Payne was transferred to the White House at the time of the inauguration of President John F. Kennedy. He continued to work at the White House under President Lyndon B. Johnson.

Mr. Payne later was assigned to the Washington field office of the Secret Service and to several headquarters divisions. In 1970, he received a special achievement award for his work as special agent in charge of the foreign dignitary protective division. He supervised security arrangements for White House visits by 25 heads of state.

Mr. Payne was promoted to assistant inspector in 1973 and continued in that rank until his retirement in 1978. Survivors include his wife, the former Jeanne Helm of Annandale.