The origins of the church are traditionally related to the chapel of Bishop Albert's castle first mentioned in written sources in 1209 that, according to the conventions of that period, should have been located in the eastern end of the building's second floor.
On 8 September 1234, at the request of the Papal Nuncio William of Modena, Bishop Nicholas put "the stone castle with respective allotments by the River Rīdziņa" at the disposal of Dominicans, thus establishing a mission of this order in Rīga. It was an order of preacher friars, which, under the regulations of the General Chapter of Rome of 1222, could possess no property, except monastery and church buildings. Only in 1425 the Pope permitted Dominicans to acquire real estate and secure sources of income.
In 1234 the castle chapel was consecrated as St. John's church, dedicating it to John the Baptist and John the Evangelist. This event is supposed to prove the hypothesis that the St. John's Church draws its origins from the chapel of Bishop Albert's castle in Rīga.
The first St. John's church was built between 1234 and 1297; it must have been a "dark and confined little church" without a belfry and a transept. We can only have an approximate idea of the shape, place and dimensions the predecessor of the St. John's Church had: the building has been reconstructed a number of times and has long ago lost the austere and robust lines characteristic of the early 13th century architecture.
Yet another open question is whether St. John's Church has indeed originated from the enlarged chapel in Bishop Albert's castle, because its location in the south eastern end of the castle and the limited funds of the Dominicans are rather speculations as to the reason why the monks acted in a certain way than documentary evidence.