Puigcerdà is the capital of the Catalan comarca of Cerdanya, in the province of Girona, Catalonia, northern Spain, near the Segre River and on the border with France.