The ATLAS experiment at the Large Hadron Collider (LHC) employs a trigger system consisting of a first-level hardware trigger (L1) and a software-based high-level trigger. The L1 muon trigger system selects muon candidates, assigns them to the correct LHC bunch crossing and classifies them into one of six transverse-momentum threshold classes. The L1 muon trigger system uses resistive-plate chambers (RPCs) to generate the muon-induced trigger signals in the central (barrel) region of the ATLAS detector. The ATLAS RPCs are arranged in six concentric layers and operate in a toroidal magnetic field with a bending power of 1.5 to 5.5 Tm. The RPC detector consists of about 3700 gas volumes with a total surface area of more than 4000 m2. This paper reports on the performance of the RPC detector and L1 muon barrel trigger using 60.8 fb-1 of proton-proton collision data recorded by the ATLAS experiment in 2018 at a centre-of-mass energy of 13 TeV. Detector and trigger performance are studied using Z boson decays into a muon pair. Measurements of the RPC detector response, efficiency, and time resolution are reported. Measurements of the L1 muon barrel trigger efficiencies and rates are presented, along with measurements of the properties of the selected sample of muon candidates. Measurements of the RPC currents, counting rates and mean avalanche charge are performed using zero-bias collisions. Finally, RPC detector response and efficiency are studied at different high voltage and front-end discriminator threshold settings in order to extrapolate detector response to the higher luminosity expected for the High Luminosity LHC.