WASHINGTON — Representative Trent Franks announced Friday that he would resign from Congress immediately after accusations emerged that he had offered $5 million to a female employee to be a surrogate mother for his children, and that she and another female employee worried that the lawmaker wanted to have sex as a means of impregnating them.

Mr. Franks, Republican of Arizona and one of the House’s most ardent social conservatives, had said Thursday that he would leave the House in January, and he admitted that he had discussed surrogate pregnancies with two employees. The House Ethics Committee had opened an investigation into his behavior, and the office of Speaker Paul D. Ryan said in a statement that Mr. Ryan had made it clear that Mr. Franks’s actions were intolerable.

On Friday, Mr. Franks changed course and said he would leave immediately because his wife, Josephine, had fallen ill and had been hospitalized in Washington.

“After discussing options with my family,” he said in a statement, “we came to the conclusion that the best thing for our family now would be for me to tender my previous resignation effective today.”