Three of the protesters, including labor leader Eliseo Medina, 67, have not eaten for 18 days and are drinking only water.
Obama and his wife, Michelle, met with the group for about 30 minutes in a heated tent near the steps of the Capitol to discuss the immigration bill that has stalled in the House.
"He was really concerned about our health," said Christian Avila, 23, a student from Arizona who stopped eating on Nov. 12. "He said we might think about handing the torch over ... and taking a break."
Avila — who wore a brown hooded sweat shirt that read "Act. Fast." — said he planned to avoid eating as long as he could.
Obama told the group that he had instructed his staff to figure out what else they can do to get an immigration bill to his desk. He said he believes
"It's not a mater of if, but when," the president said, according to Avila.
Rudy Lopez, a community organizer from East Chicago, Ind., told the Obamas he joined the fast in part because one of his relatives had died in 2005 crossing the Southwest border to start a construction job in Houston. Michelle Obama hugged him, he said.
"The first lady was moved," said Lopez, who had been fasting for nine days.
In June, the Senate passed an immigration bill that would increase spending by more than $30 billion for border security and allow most of the estimated 11 million people in the country illegally to eventually become citizens after paying fines and submitting to background checks. The bill has gone nowhere in the House.
The hunger strikers also have been visited by Vice President Joseph Biden, Agriculture Secretary
Shortly after the Obamas' visit, Kathleen Kennedy Townsend, daughter of the late Robert F. Kennedy, stopped by to sit with the fasters. In 1968, shortly before he was assassinated, her father visited Cesar Chavez in Delano, Calif., where the labor leader was fasting to bring attention to the working conditions of farmworkers.
"There is a moral quality to what kind of country we are," Townsend said after meeting with the protesters. "That is what my father believed.... This is about real people and their lives."