Secretary of State John Kerry on Friday left the hospital where he has been recovering from a broken leg after a bicycling accident, and said he expects to join the Iran nuclear talks for their “last slog” at the end of June.

Kerry, who is 71, emerged from Massachusetts General Hospital in Boston shortly before 5 p.m., walking gingerly on two crutches. He wore what appeared to be white running shoes instead of his normal wingtips, and he looked pale after spending almost two weeks in the hospital. But he seemed in good humor as he joked that he was loves exercising and was looking forward to more physical therapy.

“I’m confident I’ll be as good to go as I was before. If not stronger,” he told reporters waiting for him at the hospital entrance.

Kerry said he would spend the weekend at his Boston residence with his wife, Teresa, and expects to return to Washington next week.

He said he will be in Washington for talks with Chinese officials scheduled for July 23 and 24.

Kerry has been a critical figure in the talks with Iran, which face a June 30 deadline for a deal to rein in Iran’s nuclear program in exchange for lifting sanctions. State Department officials had given assurances he would be able to join the talks when necessary, but some had feared his recovery process might prohibit him from participating in person, a prospect that threatened to doom the outcome.