Spain's attorney general José Manuel Maza died suddenly in Argentina on Saturday, where he was attending a conference. He was 66.
Earlier in the day he had been reportedly taken to an intensive care unit with a kidney infection, reports BBC.
Last month, Maza called for charges to be brought against Catalan leaders, following a banned independence referendum in the region.
Spain's political leaders have been paying tribute.
In a tweet (in Spanish), Prime Minister Mariano Rajoy expressed his "deepest condolences" to Maza's family and friends.
Justice Minister Rafael Catalá described Maza as an extraordinary lawyer and public servant.
Maza was appointed Spain's attorney general in November 2016.