At the beginning of the week, Senator Chuck Schumer of New York said he was optimistic about the prospects for immigration reform, “I think we’re doing very well. I think that we hope that we can have a bipartisan agreement from the eight of us on comprehensive immigration reform by the end of this week,” he said on CBS’ Face the Nation.

There were signs Republicans weren’t so eager to move forward with a deal, but as it turns out, Schumer’s optimism wasn’t misplaced. According to the New York Times, the bipartisan “Gang of Eight” has reached an agreement on a comprehensive immigration reform plan.

By and large, the bill doesn’t depart from the framework established by President Obama and seconded by Marco Rubio, among others. It establishes a provisional status for unauthorized immigrants who who pass background checks and fulfill other requirements, such as paying fines and back taxes to the federal government. It also requires them to wait ten years before they can apply for green cards, a change from Obama’s plan, which proposed an eight year wait.

This is broadly in line with public opinion. According to the latest poll from NBC News and the Wall Street Journal, 64 percent of Americans support a path to citizenship for unauthorized immigrants, a number that jumps to 76 percent when a proposed pathway includes fines, penalties, and a background check. It should be said, however, that few Americans support the long timeline for citizenship —18 percent say unauthorized immigrants should be immediately eligible for citizenship if they have jobs, while 51 percent say they should be eligible have jobs and have been in the country for five years. Only 12 percent agree with the “Gang of Eight” that ten years is necessary before citizenship can become an option.

With all of that said, the most important component of the bill — for political reasons — is border security. And there, Democrats and Republicans have built a compromise that might earn wide support from GOP lawmakers. As the Times notes, the bill sets several goals for border authorities, “continuous surveillance of 100 percent of the United States border and 90 percent effectiveness of enforcement in several high-risk sectors,” as well as workplace and visa enforcement measures. It also provides billions in new funding to the Department of Homeland Security, and includes “triggers” to ensure that enforcement goals are met. One trigger, for example, is a requirement that DHS provides a five-year border security plan before the federal government can give legal status to unauthorized immigrants.

This component of the bill allows Republicans to say that the government is placing a priority on border security, providing a carrot of sorts to conservative lawmakers who fear “amnesty” as a result of immigration reform. But the bill doesn’t come with hard targets for border security, which fulfills Democratic demands that immigrants have an unencumbered path to citizenship.

There are still a host of obstacles left for this bill before it reaches the floor of the Senate — much less comes to a vote — but for now, it’s fair to say immigration reform may become a reality. More importantly, passage for immigration reform will illustrate a key reality of the current political moment. Presidential leadership won’t break gridlock. Action will only happen when both sides feel that it is in their best interests. And as of now, immigration is the only issue where that’s true.

More broadly, the progress on immigration suggests that the key for future battles is to make Republicans see that their interests lie in coming to a deal. But, as we’ve seen over the last four years, that’s easy to say, and difficult to do.

Jamelle Bouie is a staff writer at The American Prospect, where he writes a blog.