Bernard II (in Catalan, Bernat de Gothia) was the Count of Barcelona, Girona and Margrave of Gothia and Septimania from 865 to 878.
Bernard was the son of Bernard I, count of Poitou (814-844), and Bilichilde, daughter of Rorgon I, count of Maine. He was the paternal cousin of Emeno, Count of Angoulême (839-863), who died fighting the Vikings. On his mother's side he was a nephew of Rorgon II of Maine and of the royal Chancellor Gauzlin, Abbot of Saint-Germain-des-Prés.
Bernard was loyal to King Charles the Bald in the civil war that erupted in 851. After the flight of Humfrid in 864 and the death of the other rebels, Charles redistributed the counties and marches of Spain and Languedoc (March of Gotia). In 864, Bernard was installed in the counties of Auvergne and Autun in central France after Bernard Plantapilosa (son of Bernard of Septimania) was dispossessed of them for rebellion. At that time Auxerre and Nevers were given to Robert the Strong who also received Autun in 865. In 865, Toulouse, Limousin, Pallars, and Ribagorza were entrusted to Bernard, son of Raymond I of Toulouse. Raymond had been dispossessed by Humfrid three years before. Ermengol, Count of Albi, received Rouergue, and Oliba received Carcassonne and probably Razès.