The Senate easily approved the amendment on Monday, which won support from Republicans who initially rejected the bill.

Democrats hesitated in supporting the amendment, considering it will double border security officials. However, left wing senators managed to win their “path to citizen” clause, which allows illegal immigrants to earn U.S. citizenship without being deported.

Despite opposition to certain amendments on both sides, the bipartisan bill is expected to pass in the House.

“This is a border security measure which I think should suffice to satisfy any critic it,” McCain said, in a surprising statement of compromise. “It is a way forward so that we can resolve this and bring 11 million people out of the shadows.”