ENGULFED by India, its giant neighbour to the west, north and east, Bangladesh can look small. But it is the world’s eighth most populous country, with one of its fastest-growing economies. And its location, between India and South-East Asia, with a long littoral on the Indian Ocean, puts it in the thick of things, geopolitically speaking.

China clearly sees some potential. Xi Jinping, its president, visited last year and pledged $15bn in loans. China is Bangladesh’s biggest trading partner—and arms make up a good chunk of that trade. Two Chinese submarines arrived on credit in March. Bangladesh is the third-biggest buyer of Chinese arms, after two other neighbours of India, Pakistan and Myanmar.

India is responding with a charm offensive of its own. When Bangladesh’s prime minister, Sheikh Hasina, made a four-day state visit to Delhi that concluded on April 10th, her Indian counterpart, Narendra Modi, made sure she did not go back empty-handed. He offered $5bn in loans, including $1bn for a Russian-backed nuclear plant, Bangladesh’s first; and $500m to buy Indian arms. The two countries signed a defence agreement committing them to deeper co-operation. India promised more cross-border electricity and railway lines.

But there was no progress on what mattered most to Sheikh Hasina: a treaty on how to share the water of the 53 rivers that flow from India to Bangladesh. One river in particular, the Teesta, has become the focus of attention. Bangladesh wants the water split evenly, whereas the Indian state of West Bengal claims 55%. Mr Modi has promised to resolve the issue, but his Bharatiya Janata Party (BJP) governs only one of the four states bordering Bangladesh. The chief minister of West Bengal refuses to let him bid away her state’s stake in the Teesta. Sheikh Hasina had made an urgent pitch in the Hindu, an Indian newspaper, arguing “friendship is a flowing river”. She went home shrugging: “We sought water, but got electricity.”

Even if the water of the Teesta was his to give, Mr Modi might find it awkward to become too chummy with Sheika Hasina. Stoking resentment against Muslims, and against illegal immigrants from Bangladesh in particular, has proved a successful electoral formula for the BJP. Sheikh Hasina, for her part, is ignoring the Bangladeshi army’s instinctive suspicion of India to sign the security pact. The opposition Bangladesh Nationalist Party (BNP) has accused her of selling out, and promised to scrap it if it comes to power. The Teesta is another handy stick with which the BNP can beat the government. Geography has thrust India and Bangladesh together, but domestic politics still pushes them apart.