The HBO late-night host Bill Maher apologized on Saturday for using a racial epithet during an interview with Senator Ben Sasse, Republican of Nebraska, on a live broadcast of his show on Friday night. HBO denounced the remark as “completely inexcusable and tasteless,” and said it would be edited out of future airings.

Shortly after 10 p.m. on Friday, Mr. Maher, the comedian and host of HBO’s “Real Time,” was talking to Mr. Sasse on his program about the boundaries between adolescence and maturity, and how adults in California still dress up for Halloween.

When Mr. Sasse said this did not happen in his state, Mr. Maher said, “I’ve got to get to Nebraska more.”

Mr. Sasse replied: “You’re welcome. We’d love to have you work in the fields with us.”

Mr. Maher said: “Work in the fields? Senator, I’m a house nigger. No, it’s a joke.”