Updated

Rep. Mo Brooks, R-Ala., announced Wednesday that he's grappling with “high-risk” prostate cancer in an emotional House floor speech.

"God works in mysterious ways; when you are an elected official, missed votes require an explanation," Brooks said. "That is why I disclose this otherwise very personal, very private and very humbling matter."

Brooks, who lost the Republican primary for the Alabama Senate seat, said that outcome saved his life because he was then able to get a physical and prostate-specific antigen (PSA) test. Had he won, he said, he would have postponed the test.

"I would not have had a prostate biopsy," the congressman said. "I would not now know about my ‘high-risk’ prostate cancer that requires immediate surgery.”

Brooks received his diagnosis on Halloween and called his wife to share the news. "That night was one of the loneliest nights apart in our 41-year marriage. I kept thinking about my wonderful family, ‘What do I do next,’ and ‘How do I beat this cancer?’"

Brooks is set to undergo surgery on Friday to allow for a recovery just in time for the holidays. He intends to return to work when Congress reconvenes on Jan. 3.

He said his grandfather and father had prostate cancer. His grandfather's diagnosis came late, a prelude to his death soon after. His father, in contrast, lived for decades after he caught the cancer early and had surgery.

The Alabama Republican Party tweeted shortly after the announcement: "Please join us in praying for @RepMoBrooks this morning and in the coming days and weeks ahead. We are thankful for Rep. Brooks and his support of the ALGOP."

"I’m very sorry to hear that my colleague and my friend, Mo Brooks, has been diagnosed with prostate cancer," said a fellow representative, Robert Aderholt, R-Ala. "I will be praying for him, his family and for a speedy and complete recovery."