In 18th century Europe, the baroque guitar evolved from an instrument with 5 courses to one with 6 courses - initially the courses were paired strings but later the consensus of popularity favoured single strings as is common today - so it was perfectly natural that someone would take this a stage further and add a 7th course (or string). Those advocating the 7-string guitar included French guitarist Napoleon Coste (1805–1883) who composed specifically for the instrument, and the Italian guitarist Mario Maccaferri (born 1900) who used additional unfretted bass strings (known as diapasons or bourdons) on his guitars.
The above pictured guitar is an Italian 7-string by Ermelinda Silvestri and dates to the mid 1890s. In keeping with most of Silvestri’s instruments it bears the butterfly inlay which was a trademark of sorts. The seventh string seems to be very close to the edge of the fingerboard, which suggests that it wasn’t intended to be fretted and would have been a diapason (or bourdon if you prefer).