"Built in 1225, it’s one of the most ancient churches of Riga, and it served as its cathedral until the opening of the Dome. During the protestant Reform, in 1523, it became the first protestant Latvian church in Riga. But 60 years later, when the city came under the control of the Polish-Lithuanian Commonwealth, the king Stephan Batory gave the church to the Jesuits, as part as the counter-reformation measures, and it became catholic again. In 1621, when Gustav of Sweden invaded Latvia, the church was given back to the Lutherans.
In 1812, when Napoleon took Riga on his way to Russia, the church served as food storage. In 1923 it was finally given back to the Catholics as the catholic cathedral of Riga. Its proper name is St. James, but it’s usually confused because in Latvian, as in many other languages, there is only a single name for both Jacob and James."
-- GoingRussia
"St. James's Cathedral, or the Cathedral Basilica of St. James, (German: Jakobskirche, Latvian: Sveta Jekaba katedrale) is the Roman Catholic cathedral of Riga in Latvia. The cathedral is dedicated to Saint James the Greater. The building is part of the Old Riga UNESCO World Heritage Site and lies directly opposite the House of the Livonian Noble Corporation, the meeting place of Latvia's parliament the Saeima.
The church is sometimes wrongly called St. Jacob's. The confusion arises because Latvian, like many other languages, uses the same word for both James and Jacob.
History
The church building was dedicated in 1225. It was not originally a cathedral since the Rigas Doms served that function. At the beginning of the 15th century the Holy Cross Chapel was built at the south end of the early Gothic church, and part of the church was transformed into a basilica.
In 1522 during the Protestant Reformation the building became the second German language Lutheran church in Riga. In 1523 it became the first Latvian language Lutheran church there.
In 1582 it was given to the Jesuits as part of the Counter-Reformation when Stephen Báthory of the Polish-Lithuanian Commonwealth gained control of Riga. In 1621 it was given back to the Lutherans after Gustav II Adolf of Sweden occupied Riga. At various times it served as a Swedish language, German language, or Estonian language Lutheran church. In 1812 it was used as a food storehouse by Napoleon's troops.
In 1901 the oldest Baroque altar in Riga from 1680 was replaced by a new one. Following a referendum in 1923, the building was given back to the Catholics for use as their cathedral since the Rigas Doms was now an Evangelical Lutheran cathedral."
-- Wikipedia