President Trump made his first official visit to India this week. In a trip that some analysts suggest catered more to optics than outcomes, there were some surprises — most notably, religious riots surrounding the government’s new citizenship law — that exposed the vulnerability of U.S. relations with India.

Here are four takeaways from Trump’s trip.

1. The good: Defense agreements and sales

The U.S. and India announced a deepening of their security relationship to promote a free and open Indo-Pacific, including a “comprehensive global strategic partnership” encompassing cooperation on maritime and space domain awareness, enhanced military exchanges and training, defense industry collaboration, secure 5G networks, sustainable infrastructure investments and efforts to combat terrorism and drug trafficking.

The big headline was an Indian commitment to procure $3 billion in U.S. military equipment.

The U.S. seeks to bolster India as part of its effort to be a balance to China and enhance the ability of U.S. and Indian forces to work together — known as interoperability — in the Indian Ocean region. But this defense partnership has fallen short of some expectations owing to structural limitations and American wishful thinking.

U.S. arms sales to India have grown from zero to around $18 billion during the past 15 years, but frustrations abound over the painstakingly difficult and slow Indian defense procurement process — which took 32 years to complete a deal for 145 American towed artillery pieces.

The president’s plan to sell 24 MH-60 Seahawk multirole helicopters replaces a previous procurement that was tendered by India in 2009, selected in 2014 and then canceled in 2017. The two sides have yet to finalize cost negotiations on the new deal, but even after signing, delivery of the air assets would not begin for another three years.

Nevertheless, for the United States, the deal shows progress since it boosts trust through the provision of sensitive technology, facilitates greater interoperability and enhances India’s ability to secure the Indian Ocean region.

The Modi government praised the deal as a means to “advance shared security interests, job growth and industrial cooperation.” For India this is a step toward managing the trade-offs between a desire to immediately acquire state-of-the-art military capabilities and need for technology transfers to eventually build more of its own modern weapons systems.

2. The bad: No trade deal

Bilateral trade has grown steadily, despite being hobbled by significant disputes. Analysts expected a trade deal to be a major deliverable of Trump’s visit, but one never emerged. And there was no announcement of a Westinghouse deal for six nuclear reactors.

U.S. Trade Representative Robert E. Lighthizer’s absence from the trip suggested a trade deal was not imminent, but the lack of anything concrete reveals just how far apart the United States and India are on a litany of issues, including trade deficits, agricultural tariffs and non-tariff barriers, intellectual property rights, investment barriers, H1-B visas and digital services.

The obstacles to better trade relations not only stem from the president’s own transactionalist approach but also India’s recent protectionist turn toward import substitution and the “Make in India” initiative.

India walked away from the Regional Comprehensive Economic Partnership last December, reflecting a desire to protect farmers, small businesses and large conglomerates. India’s protectionist impulses also reflect lobbying by key constituencies as well as political concerns that major dislocations from trade could exacerbate an already stagnating economy with high unemployment.

3. The ugly: Communal violence

Some of the worst communal violence in decades between Hindus and Muslims broke out during Trump’s visit to the Indian capital, precipitating questions about shared democratic values with the United States. Soon after Trump’s departure, the U.S. Embassy issued a security alert to U.S. citizens in Delhi.

Rock-throwing between groups of Hindu and Muslim men intensified into wider clashes and rioting that left at last count 27 people dead and roughly 200 injured, and damage to Muslim neighborhoods, shops and mosques.

Trump applauded Modi’s efforts for religious freedom only a few miles from this violence. That contrasts with Barack Obama’s January 2015 visit, when he prodded the Indian leadership on the importance of religious freedom.

Before the Trump visit, a bipartisan group of congressional leaders — including close Republican allies like Sen. Lindsey O. Graham (R-S.C.) — expressed concerns over changes to the constitutional status of India’s only Muslim-majority state, Jammu and Kashmir, the political detentions and suspensions of communications there and the changes to India’s citizenship laws. Days before the Trump visit, House Foreign Affairs Asia subcommittee Chairman Ami Bera (D-Calif.) discussed his fears that India could “lose that secular democracy” that “makes it such a valuable partner.”

As communal violence draws U.S. media attention, it may stoke further congressional criticism and U.S. anxiety over whether India really does possess the “shared sense of values” that are supposed to anchor the relationship.

4. The surprising: Gestures to Pakistan

A surprising feature of the trip came during Trump’s speech in Modi’s political base of Ahmedabad. Trump lauded progress in U.S.-Pakistan relations and counterterrorism cooperation and expressed hope for “reduced tension, and greater stability and future harmony for all the nations of South Asia.”

During the next day’s media engagement with Modi, Trump offered to mediate the India-Pakistan dispute over Kashmir, then backtracked. Although he has repeated this offer several times, it only serves to anger India, which views Kashmir as a bilateral issue.

Why did Trump go out of his way to praise India’s chief rival? This move may have sought to reassure Pakistan, which has played an “indispensable role” in the Trump administration’s efforts toward a sustainable peace agreement in Afghanistan and fulfillment of Trump’s promise of a U.S. troop drawdown.

Overall, despite shortfalls on trade, Trump’s India trip delivered some pragmatic defense gains that should strengthen the U.S.-India relationship.

But the persistent perceptions of India’s increasingly illiberal and majoritarian turn — stemming from Kashmir to citizenship laws to communal clashes in New Delhi against the backdrop of Trump’s visit — could arouse enough U.S. concern to erode bipartisan congressional support and Washington’s “conviction” in the inherent good of the strategic partnership.

Sameer Lalwani (@splalwani) is a senior fellow and director of the South Asia Program at the Stimson Center and author of “Great Expectations: Asking Too Much of the US-India Strategic Partnership” in the Fall 2019 issue of the Washington Quarterly.