A man of deep Christian faith, Mr. Scalise repeatedly thanked God for his recovery, and he spoke of how he prayed during the chaotic, terrifying moments after the gunman had wounded him.

“When I was laying on the ground one of the things I prayed for was that David and Crystal would be successful in carrying out their duties,” Mr. Scalise said, adding, “When I was laying there not long after the first shots were fired, I could hear a different-caliber weapon. And that told me that they had immediately engaged the shooter.”

The gunman died after a shootout with the police.

Mr. Scalise, 51, was grievously injured, and said he had undergone “many, many surgeries” and was learning to walk again. His office said he had spent the months since the shooting in an inpatient rehabilitation center, but that starting on Thursday, he would be back at work and undergoing outpatient therapy.

“I’m definitely a living example that miracles really do happen,” he told his colleagues.

The 15-minute speech, in a chamber packed with Republicans and Democrats who repeatedly gave him standing ovations, marked the first time Mr. Scalise has spoken of his ordeal; he has also granted an exclusive interview to the CBS news show “60 Minutes,’’ which will air on Sunday night. A crew from the network followed him in the Capitol on Thursday.

The shooting took place at a baseball field in the Washington suburb of Alexandria, Va., on June 14. Mr. Scalise said he had arrived at about 6:30 a.m. to practice with other Republican lawmakers for Congress’s annual charity baseball game. (Democrats were having their own practice at another field, he said.) The gunman, later identified as James T. Hodgkinson, 66, of Belleville, Ill., a suburb of St. Louis, opened fire shortly after 7 a.m.