Context: In contrast to traditional software systems that are mostly created from scratch, current software systems are engineered as a junction of systems already in operation. Examples can be found in domains, such as smart cities, crisis and emergency, IoT, big data, industry 4.0, and connected health systems. Most of them can be considered systems-of-systems (SoS), since they refer to alliances of operational and managerial independent software-intensive systems, which are sometimes distributed over different environments. Therefore, SoS software architectures must be dynamic, evolve over time, and support the execution of emergent behaviors to accomplish SoS missions. They must be also designed to enable the connection of heterogeneous systems, making possible their interoperation, communication, coordination, cooperation, and collaboration, most of the times, in a seamless way. Similar challenges have been addressed by using software mediators as architectural entities. However, the application of mediators in SoS has not been properly explored. Goal: This article introduces MediArch, a layered architecture that considers mediators as first-class software entities to be used in the construction of SoS architectures. Our objective is to present evidence about how MediArch's can support the construction of SoS architectures. Methods: The following four steps were conducted to define MediArch: (1) identification of mediation requirements to allow SoS properties; (2) establishment and categorization of twelve types of mediators, for enabling capabilities of communication and control of constituent systems interactions and conversion of heterogeneous messages exchanged through a mediation infrastructure; (3) specification of duties, behaviors, assumptions, and guarantees of mediators; and (4) organization of MediArch in three layers, namely, the constituents & consumer systems layer; the communication, conversion, & coordination layer; and the control layer. This architecture was used as the backbone for the software architectures of two SoS in different domains, namely, flood monitoring system-of-systems (FMSoS), and health-care supportive home system-of-systems (HSH-SoS), for providing evidence on how MediArch supports the architecting process of SoS. Results: MediArch (1) supports the integration of independent constituent systems, (2) provides strategies to manage emergent behaviors, (3) defines different schemes of control authorities, (4) offers elements to support SoS evolution, and (5) promotes the resilience and adaptability of SoS architectures. Conclusions: Although MediArch contributes to the establishment of SoS architectures, some challenges related to performance, resource consumption, security, safety, and non-disruptive reconfigurations must still be overcome.