MUMBAI, India — The state that includes Mumbai, India’s financial capital, this week became the latest state to ban the possession and sale of beef, imposing fines and up to five years in prison for violations.

The ban in the populous western state of Maharashtra, which was passed Monday, came as an amendment to a 1972 law prohibiting the slaughter of cows, which has been expanded to ban the slaughter of bulls, bullocks and calves. The slaughter of water buffaloes will still be allowed, subject to permission from the authorities.

The Maharashtra Animal Preservation bill, championed by right-wing Hindu organizations, was first passed in 1995 but languished for two decades under a governing coalition between the Indian National Congress and the Nationalist Congress Party. The Hindu nationalist Bharatiya Janata Party was the clear winner in state elections last October after Narendra Modi, the party’s leader, took office as prime minister in May.

The law, which allows a fine of 10,000 rupees, about $162, took effect Monday night after approval from India’s president, Pranab Mukherjee. Maharashtra’s chief minister, Devendra Fadnavis, gave the president credit and expressed his thanks over Twitter.