A majority of people believe illegal immigrants should be allowed to stay in the U.S., according to a Pew Research survey released on Thursday.

Seventy-one percent said illegal immigrants should be allowed to stay, against 27 percent who said they should not be allowed to remain in the country.

However, proponents of allowing illegal immigrants to stay are split on how that should be accomplished. Forty-three percent said they should be eligible for citizenship, 24 percent said they should be limited to permanent residency and 4 percent were unsure how it should be accomplished.

In an interview on Wednesday, President Obama said he was confident lawmakers would agree on immigration legislation by the end of the summer. A bipartisan Senate group is working on a bill that would tighten border security and provide an opportunity for citizenship to illegal immigrants that meet certain criteria.

The Pew survey of 1,501 adults was conducted between March 13 and March 17 and has a 2.9 percent margin of error.