A few weeks before Sen. Bernie Sanders (I-VT) launched his presidential campaign, he and Rep. Ro Khanna (D-CA) went out for what Khanna thought was going to be a late lunch focused on policy strategy.

Over plates of greasy Chinese food, Khanna and Sanders talked about how technology and artificial intelligence are disrupting the economy and driving income inequality, how to help workers affected by those changes, their shared push to end U.S. involvement in the Yemen civil war, and Sanders’ broader foreign policy vision.

“We spent 40 minutes discussing the substance of all of these things. And then he said ‘Okay, I don’t like talking about politics, but you’re going to be my co-chair,’” Khanna told TPM during a recent meeting in his office. “I said, ‘Okay? … let me think about it.’ And he said, ‘Here’s our strategy.'”

Khanna agreed to join Sanders a few days later. The second-term lawmaker is poised to play an influential role on a top-tier presidential campaign — a major position that’s thrust him into the national spotlight.

But if Khanna was caught a bit off-guard by Sanders’ offer, his answer shocked some back home.

“I thought, ‘That’s a little odd,'” former San Jose Mayor Chuck Reed (D), a moderate and longtime Khanna supporter, said with a laugh when asked about Khanna’s role on the Sanders campaign. “Sanders is not a capitalist. I think Ro Khanna is.”

Khanna’s embrace of Sanders is the latest move in a career viewed by his allies as bold and daring, and by his detractors as self-serving and impulsive.

Khanna, 42, came to Congress by defeating liberal stalwart Rep. Mike Honda (D-CA) with the backing of the Silicon Valley “millionaires and billionaires” that Sanders often rails against. A decade earlier, he’d run a quixotic anti-war campaign against another California Democrat. Throughout his political career, Khanna has veered from outsider rabble-rouser to loyal party foot soldier and back.

The sophomore lawmaker has emerged as a leading progressive voice in the House, a top Sanders ally and a ubiquitous presence on cable TV. Working with Sanders, he helped pass the first-ever war powers resolution to curtail U.S. involvement in the Yemen civil war, a move that drew strong praise from party leaders.

He’s been unafraid to buck party leadership and unusually active in pitching new policy proposals. Like the Silicon Valley startups he fashioned his campaign after, he’s been more willing to take risks — and make mistakes — than some other lawmakers.

His Sanders move is the latest that’s surprised both allies and detractors.

“On an individual basis they like him,” one Khanna ally in the tech community said about Khanna’s more conservative supporters. “They’re just scratching their heads wondering ‘Ro, what the fuck is this with Bernie?'”

Khanna remains an optimist about technology who is friendly with TED-talking Silicon Valley thought leaders, a creative policy wonk, disruptive outsider, and champion of generational change who has pissed off a number of older lawmakers since he got to Congress.

He’s also a party loyalist who describes himself as “very, very close” to House Speaker Nancy Pelosi (D-CA), and is backing a democratic socialist who could become the oldest newly elected president in history.

“He marches to his own drummer. … Certainly his success with the Yemen resolution is a big feather in his cap,” said Rep. Zoe Lofgren (D-CA), a fellow member of Congress from Silicon Valley. “He has positioned himself very much on the progressive end of things, which is not how he ran that I was aware of in the race against Honda.”

The Diaspora

Khanna grew up around Philadelphia, the son of immigrants. His grandfather was an Indian independence movement leader who spent four years in jail.

“He’s a legend in our family,” Khanna said.

Khanna knocked on doors for state Senate candidate Barack Obama while at the University of Chicago. After Yale Law School, he went to work in intellectual property law for a white-shoe corporate firm in the Bay area.

Then-Rep. Tom Lantos (D-CA), the only Holocaust survivor in Congress and at the time the top Democrat on the House Foreign Affairs Committee, was a leading Democratic supporter of the U.S. invasion of Iraq.

Khanna, then 27 and still new to the area, ran against Lantos in 2004, attacking his support for the war and the Patriot Act. Khanna received support from anti-war activists and drew some national attention, but Lantos stomped him on Election Day, winning 74%-20%.

“I was a little bit shell-shocked after that run, to be honest, and didn’t run for 10 years afterwards because I lost so badly,” Khanna said.

But Lantos was impressed. He took Khanna out to breakfast, jokingly warned him never to run against him again, and proceeded to introduce him around to the area’s Democratic kingmakers.

“My father recognized Ro Khanna as a talented individual and he often took bright, rising leaders under his wing,” Katrina Swett, Lantos’ daughter, told TPM.

One of those introductions was to then-House Minority Leader Nancy Pelosi (D-CA), whose patronage would help Khanna become a serious political player. She encouraged him to get more involved in the party, and honored Khanna in 2006 at a banquet with a “trailblazer” award for his fundraising efforts in the Indian-American and tech communities .

Pelosi put in a good word with incoming White House Chief of Staff Rahm Emanuel when Khanna sought to join the new Obama administration in 2008.

“She opened doors for him,” said venture capitalist and former California state Controller Steve Westly (D). “She has really invested in him and brought him up in the leadership ranks.”

Khanna became deputy assistant secretary in the Commerce Department, leading U.S. trade missions abroad to try to boost American exports as well as trips to American manufacturing hubs in places like Oshkosh, Wisconsin. That led to a book, “Entrepreneurial Nation: Why Manufacturing is Still Key to America’s Future.”

Back To The Bay

Khanna left the administration in late 2011, returning to the South Bay.

He almost ran against Rep. Pete Stark (D-CA) in 2012 — “He agonized over that,” one source who discussed the race with Khanna told TPM — but opted to wait to see if Stark would retire. Eric Swalwell swooped in and beat Stark, disrupting Khanna’s plans.

Khanna then turned his sights on Honda. Stark and Honda were both past their primes. But while the hotheaded Stark had many enemies, Honda was a beloved figure locally. A former Democratic National Committee vice chairman who’d spent part of his childhood in a Japanese internment camp, Honda was close to the labor community and a strong champion of civil and LGBTQ rights.

Khanna hired Jeremy Bird and Larry Grisolano, two top Obama advisers, and framed the race as a generational battle.

He racked up endorsements and donations from the Silicon Valley elite. His campaign chairman, angel investor Steve Spinner, had been a top Obama fundraiser. Supporters included Facebook’s Sheryl Sandberg, PayPal’s Peter Thiel, Google’s Eric Schmidt, Napster and Facebook’s Sean Parker, and Yahoo’s Marissa Mayer.

“We haven’t had the young, dynamic, hard-driving candidate that really understands the unique issues facing Silicon Valley right now,” Parker said as he introduced Khanna at a 2014 event.

Khanna largely avoided policy contrasts — but his 2014 campaign was filled with moderate third-way rhetoric.

Khanna called for “a Congress that isn’t beholden to the extreme ideology of the right or the left.” He promised lower taxes on small businesses, and said corporations should be able to repatriate their profits at a lower tax rate provided they invest it. He backed comprehensive immigration reform and progressive reforms to the visa system, but sided with big tech companies to support piecemeal legislation to increase H1-B visas for high-skilled immigrants. His campaign sent mail pieces attacking “Mike Honda’s old-school liberal orthodoxy.”

In an April 2014 op-ed, Khanna blasted Honda and the House Progressive Caucus that Khanna is now a leader in for a budget proposal that would combine “huge increases in domestic spending with huge tax increases,” knocking them for proposals that “don’t attract any Republican votes and often receive support from fewer than half of House Democrats.”

Khanna now admits that he “never read the progressive budget back in 2014.”

“In retrospect, in the heat of the campaign, I should have limited my policy differences to Honda instead of having a line about a budget I had never read. I certainly learned and grew in the course of the campaign,” he told TPM.

Khanna also made a big deal of his pledge to not take any PAC money, an easy promise since the establishment and their PACs backed Honda.

That didn’t stop Khanna’s wealthy allies from setting up a super PAC. Californians for Innovation spent a combined $1.3 million for Khanna in 2014 and 2016. More than half its money came from former Enron executive John Arnold and his wife, who’d also bankrolled various efforts to cut government employees’ pensions — including in San Jose.

Khanna filmed 40 minutes of B-roll video and posted it online, a classic move to sidestep campaign finance laws barring coordination and supply friendly super PACs with high-quality footage for their ads.

Khanna told TPM he didn’t have anything to do with the group, describing the Arnolds as friends with whom he has some “philosophical disagreements.” When asked about the B-roll, he said he’d been infuriated at the time by attacks from Honda’s allies that he viewed as racist and thought, “If there’s a group that wants to push back, fine.”

Khanna was never the fake Democrat that Honda’s campaign tried to paint him. He was always progressive on social and foreign policy and environmental issues. He called for expanded college access, higher education funding, and talked up the theories of leading liberal economists like Robert Reich and Thomas Piketty. He warned of increasing income inequality and championed an earned income tax credit.

Khanna came up just short in that 2014 race, losing to Honda, 52%-48% — a result he says forced him to think harder about what and who he stood for.

“I think I grew. I’m a better candidate for having lost to Mike Honda,” Khanna told TPM. “My optimism about Silicon Valley remains but it is more nuanced and more layered and more empathetic to the negative disruptions that have been caused and the people that have been left out.”

Khanna replaced his advisers and shifted his message. He endorsed Medicare for All. He toned down talk of bipartisanship. His ads promised a fight for “an economy for all of us.” He eventually came out against Trans-Pacific Partnership, putting him at odds with his old bosses at the Commerce Department as well as many Silicon Valley leaders.

“We did a sharper contrast in ’16 that did push particularly on economic inequality a lot more clearly,” Khanna’s 2016 adviser Joe Trippi told TPM.

Honda was also damaged by a House Ethics Committee investigation into whether he illegally used official resources to support his campaign.

Khanna trounced Honda this time, 61%-39%. More than a decade after his first House run, he was headed to Congress.

Those races left bruises — but even Honda’s fiercest allies say Khanna has worked hard to repair relationships.

“There are plenty of progressives that still have a lingering bad taste in their mouths because of those attacks on Mike Honda,” said Ben Field, the head of the South Bay Labor Council, “I don’t think the battle scars have gone away. But Ro has done what he can to heal those wounds.”

The Young Turk

Khanna wasn’t content to settle in as a back-bencher in Washington and slowly work his way up the ladder.

The lawmaker landed plum spots on the Armed Services and Budget Committees, a sign of his good standing with Pelosi (he added the high-profile House Oversight Committee this year).

He also joined the House Progressive Caucus.

“I thought, ‘Okay, that was an interesting move,'” said Mason Fong, the only Honda staffer who stayed on to work for Khanna on Capitol Hill.

Khanna has also played a growing role on tech issues. As questions mounted about how Facebook and other big companies were using consumers’ private data, Pelosi tasked Khanna to craft an “Internet Bill of Rights,” a plan he’d advocated for on the campaign trail that would force reforms on some of his district’s largest employers.

Khanna met with tech CEOs, reformers, open internet advocates and experts from across the ideological spectrum. What he unveiled was a series of proposals that would force companies to disclose more about what personal information they use and create opt-in requirements for sharing data, but doesn’t go nearly as far as recent European Union regulations in creating new consumer rights.

Pelosi’s decision to give the major proposal to a freshman irritated some more senior lawmakers, especially those the House Energy & Commerce Committee who felt that he was stepping onto their territory.

“I don’t care about turf stuff,” Khanna said. “That may rub people the wrong way but our founders didn’t intend people to be siloed into turf.”

Khanna has been willing to criticize some big tech companies in his backyard, issuing some tough love for Facebook’s privacy policies and criticizing their acquisitions of Instagram and WhatsApp as monopolistic. But his harshest criticisms of a tech company have been aimed at Amazon, headquartered hundreds of miles north. And he doesn’t support all progressive views on big tech — he came out against Sen. Elizabeth Warren’s (D-MA) recent calls to break up big tech companies.

Khanna’s policy work hasn’t drawn much criticism from within his party — but some of his political actions have.

Khanna became the first sitting lawmaker to announce his support for Justice Democrats, a left-wing organization that supports primary challenges to sitting lawmakers, in mid-2017. Through them, he decided to endorse Ferguson, Missouri activist Cori Bush in her run for Congress, not realizing that she was running against Rep. Lacy Clay (D-MO), a leader in the Congressional Black Caucus. He apologized and switched his backing to Clay, who called the misstep “water under the bridge.”

“The Clay endorsement was a mistake,” Khanna said.

If Khanna’s endorsement against Clay was a hiccup, some other lawmakers describe how he handled the race between then-House Democratic Caucus Chairman Joe Crowley (D-NY) and Alexandria Ocasio-Cortez as akin to puking on their shoes.

Khanna first endorsed Crowley. After getting heat from his leftwing allies, he endorsed her, too.

“The Joe Crowley incident made him look very stupid, avert your eyes it’s so embarrassing. And it was so high-profile around here, people haven’t forgotten it,” said one senior Democratic lawmaker. “Ro does risk being seen as nothing but opportunistic with no core principles.”

Khanna defended the dual endorsement.

“I endorsed Crowley because I thought he was a decent guy, and then Ocasio came around and I learned about her story, I thought ‘here’s this dynamic candidate, and I should validate her,” he said. “I got a little mocked, which was fine. But I don’t think I would have done anything differently there.”

Khanna has become more vocal since Democrats took back the House this year. He and Ocasio-Cortez bucked leadership to oppose House Democrats’ rules package because of “PAYGO” rules that require any new spending be offset by matching cuts or revenue increases, an embarrassment to leadership. He recently donated to moderate Rep. Dan Lipinski’s (D-IL) primary opponent. And he’s been one of the loudest critics of the Democratic Congressional Campaign Committee’s new rule that any vendors who work for lawmakers’ primary challengers would be barred from getting any work from the party, leading to tensions with DCCC Chair Cheri Bustos (D-IL).

“He’s very independent. At least what I’ve learned so far about D.C. culture, sometimes independence is a little frowned upon, but I think it’s a good thing,” Ocasio-Cortez told TPM. “That streak in him, he wields that very skillfully.”

It’s clear Khanna feels secure enough in his district — and in his relationship with Pelosi — that he’s willing to take on some Democratic sacred cows.

“I could care less about Nancy’s staff, right? Because I’m so close to her,” Khanna told TPM. “I took on [top Pelosi staffer] Drew Hammill [over PAYGO]. …I’m so secure in my relationship with Nancy, I’ve known Nancy since 2004 and Nancy has been helpful at every step of my political career.”

But even to Pelosi, Khanna hasn’t been a completely reliable foot soldier. He suggested to Vox last November that progressives should consider withholding their votes for her as speaker until she committed to addressing some of their priorities, though he said he himself wouldn’t do so because of their relationship. And the PAYGO vote frustrated many in House leadership.

“Fuck that guy,” said one staffer in another House leadership office. “He’s intelligent, I believe that he is incredibly sincere, I believe he has a great vision. But … every opportunity he takes to burn a bridge or show that he is a somewhat duplicitous human being, he takes it, and then is shocked that none of us want to sit with him at lunch.”

But while Khanna has driven some other Democrats nuts, he makes a point to reach out to people he’s sparred with before. He patched things up quickly with Clay and is now working with him on a police brutality bill. He worked closely with House Rules Chairman Jim McGovern (D-MA) to pass the Yemen resolution even after infuriating him on PAYGO, and has been helpful to former Honda backers and staff. In Khanna’s four conversations with TPM over the past week, he candidly and thoughtfully reconsidered his own previous positions and comments at least a half-dozen times.

“This is not a guy who thinks he knows it all. He is interested in outside views,” said Adam Parkhomenko, a former Hillary Clinton adviser and fierce Sanders critic that Khanna recently invited out to dinner. “He’s very open to criticism, but not just that — he actually knows if he’s wrong he’s wrong and he’s willing to admit it.”

Feeling The Bern

Khanna endorsed Clinton early on in the 2016 cycle, as he had in 2008. But he eventually dropped his endorsement of her and backed Sanders. He says that he was intrigued by Sanders’ focus on income inequality — and grew irritated with the Democrats seeking to thwart Sanders’ campaign.

“My thinking was a frustration at the establishment politics and the super-delegates,” Khanna said. “Running against an incumbent myself… the system was so hostile to outside voices and Bernie was talking about that.”

Khanna publicly supported Clinton as late as December 11, 2015, describing her then “the most effective” potential president. He’s previously said he switched his support to Sanders that same December, but told TPM he thought he’d switched in March 2016.

Khanna campaign chairman Steve Spinner said he found out about the endorsement switch right after the June California primary.

“Ro had been supportive of Hillary the whole time. But as he was listening more and more to Bernie his message started to penetrate,” Spinner told TPM. “On Election Day, Ro surprised even me by saying he was going to vote his conscience.”

In Congress, Khanna used his first House floor speech to praise Sanders’ “courageous” proposal to let the U.S. import drugs from Canada. That June, he tweeted that he wanted Sanders to run again, the first member of Congress to do so.

Soon after he became a congressman, Khanna got involved with working to end U.S. support for Saudi Arabia’s role in Yemen’s bloody civil war. In October 2017, he coauthored a New York Times op-ed with House Progressive Caucus Chairman Mark Pocan (D-WI) and anti-war Rep. Walter Jones (R-NC) decrying America’s role in the humanitarian catastrophe.

The Yemen work connected him directly with Sanders, who was leading bipartisan efforts in the Senate on the same issue.

Sanders and Khanna partnered to push the No BEZOS Act, a bill that would impose huge penalties on companies like Amazon who don’t pay workers a living wage. In response, Amazon owner Jeff Bezos agreed to raise 350,000 full-time workers’ pay to $15 an hour. The duo are now targeting Walmart with a bill that would ban stock buybacks for companies that don’t pay their workers $15 an hour. Khanna has also worked with Sanders to push for drug reimportation that would lower prescription costs.

“We connected around the ideas and the concerns that we share,” Sanders told TPM. “Ro is to my mind one of the outstanding members of the Congress. He has been a leader on virtually all of the progressive issues we’re dealing with. It’s really been a pleasure to work with him on Yemen and I look forward to continuing working with him.”

Khanna has already stepped up on the campaign trail for Sanders, introducing him at his opening-weekend rally in Chicago and again in San Francisco. He says he’s working to help Sanders frame his ideals and policies in a way that resonates with voters worried about a fast-changing economy.

“Bernie Sanders talks about the New Deal and fulfillment of some of that,” Khanna told TPM. “I want to talk about how these policies are going to help us in the 21st century.”

Khanna argues that his trumpeting of tech and Sanders support aren’t at odds. He says that technological advancement is the future of economic growth and new jobs — but that tech developments will lead to disruptions in other parts of the economy that a Sanders-style generous social safety net will help keep people from being left behind.

“One of the worst things that Democratic politicians and others do is they talk about the fear of technology and automation and artificial intelligence. If people fear the future they’re going to cling to the past,” he argued. “The fundamental debate [with] Trump is a debate between the past and the future. Trump is selling the America of the past. We have to sell the America of the future.”