Editor's note: Julian Zelizer is a professor of history and public affairs at Princeton University. He is the author of "Jimmy Carter" and "Governing America."
(CNN) -- The stars seem to be aligning for immigration reform.
The election of 2012 scared many Republicans into thinking that their increasingly hardline stance on immigration is cutting against big demographic changes. These Republicans fear that they might risk writing themselves off for decades to come, if the GOP loses a vital part of the electorate to Democrats.
A growing number of prominent Republicans are coming out in favor of a liberalized immigration policy, including the tea party darlings Sens. Rand Paul and Marco Rubio. During a recent speech to the U.S. Hispanic Chamber of Commerce, Paul said that "immigration reform will not occur until conservative Republicans, like myself, become part of the solution." Democratic Sen. Chuck Schumer of New York announced that an eight-person bipartisan group will soon reach a deal to move forward in the Senate.
So it appears that the opportunity for bold immigration reform has finally arrived. But as any observer of congressional history knows, nothing is inevitable on Capitol Hill, particularly in the current Congress, where both parties remain extremely polarized and there are high costs for bucking the party orthodoxy.
What needs to happen to close a deal? It is instructive to look back at history when Congress passed two landmark civil rights measures: the Civil Rights Act of 1964 and the Voting Rights Act of 1965. Both were highly controversial; but ultimately, they went through as a result of bipartisan deals.
Even though Congress is different in this era -- with both parties deeply divided internally and a closed committee system that dampens the power of party leaders to control members -- those historical struggles offer some instructive lessons for today as to how to seize a great opportunity that emerges.
The news media have always been a powerful force in our society. At times, they have helped push our political system toward reform. Right now, a new generation of reporters can shine by taking on the biggest stories of the day that would have long-term impact on the direction of our country.
This is what happened during the early 1960s, when a young generation of print and television reporters brought the nation vivid reports from the front lines of the civil rights struggle.
In those years, reporters covered the brutal clashes that were taking place in southern cities like Birmingham and Selma, Alabama, showing the nation the reality of race relations. When presidential speechwriter Richard Goodwin watched the clashes on his television screen, he instantly understood how the media were transforming the national conversation.
He noted, "For a century the violence of oppression had been hidden from the sight of white America. ... But now the simple invention of a cathode ray tube, transforming light into electrons, registering their impact on the magnetic tape, had torn the curtain away. And America didn't like what it saw."
Similarly, in the new Internet age that we live in, the media can offer the nation a better understanding of the plight of immigrants who are living in this country and the kinds of problems that legislation can redress. Too often, discussions about immigration have revolved around vague and caricatured images. In the next few months, young and enterprising reporters can help politicians and voters see why the government needs to resolve this issue and how it can best do so.
Another important lesson from history is the need to reach out to the other side when a rare opportunity comes along.
In the civil rights debate, President Lyndon Johnson depended on the Senate minority leader, Republican Everett Dirksen of Illinois, to deliver the votes needed to end a filibuster in 1964. In order to get Dirksen on his side, Johnson told his administration team and congressional leadership to play to Dirksen's ego and sense of history.
The key was to allow Dirksen to shape the bill, within certain parameters, so that he could leave his imprint on the measure. "You get in there to see Dirksen!" Johnson told Sen. Hubert Humphrey, the Democratic whip who was shepherding the bill through the Senate. "You drink with Dirksen! You talk to Dirksen! You listen to Dirksen!" Dirksen made some important changes to the bill during the negotiations but in the end, he delivered over 20 Republican votes, which killed the filibuster. Johnson got what he wanted.
President Obama will need to make the same kind of moves, giving Senate Minority Leader Mitch McConnell some kind of a role so that he can buy into the legislation and win some amount of credit for producing a bill. The president will need to do the same in the House, where Speaker John Boehner will play a vital role as he tries to tame the radicals in his caucus. While giving either Republican such a role might frustrate Democrats who feel that their party is in command, the results could be powerful.
Immigration rights activists can sit tight as the final months of the debate unfold. For all the talk about bipartisanship in the 1960s, the reality was that bipartisanship was often produced when legislators felt immense pressure from the grass roots.
When the Senate debated the civil rights bill in a lengthy filibuster that lasted 60 days in the spring and summer of 1964, civil rights activists -- who had already forced Congress to deal with the issue through a mass march on Washington -- conducted protests in states and districts and gathered in Washington to lobby members.
The immigration rights movement has been extremely effective in recent years, and now it must show its chops once again. It must also form alliances with other organizations, such as civil rights and gay rights groups, that have indicated they are willing to enter into a broader coalition to support this cause.
The movement needs to work on legislators who are currently on the fence, especially Republicans who are thinking of joining Rubio, Paul and others. The key is to do this without stimulating some kind of backlash in their constituencies.
The moment for an immigration deal has arrived. The political incentives for saying yes are strong in both parties, and this is an issue that needs a resolution. The key question will be whether Congress seizes this opportunity or whether partisanship paralyzes the institution once again, as it has done so many times before.
Follow @CNNOpinion on Twitter.
Join us at Facebook/CNNOpinion.
The opinions expressed in this commentary are solely those of Julian Zelizer.