The present invention relates to a device for use in peritoneal dialysis providing a sterile connection between (a) a catheter line (CL) and (b) a line (LS) for draining fluid from the peritoneal cavity and a line (LC) for supplying fresh fluid to the cavity. The device includes: (l) a housing (SL) having an external thread and which is connected at the end of the inflow/draining line (LC/LS) and in which there is provided a sheath (SLP) covering a hollow spike (SLC); (2) a cap (SC) enclosing between two perforatable membranes (SCM and SCFM) sterilizing medium. (3) a connector (F) attached to the catheter line (CL) and having a spike for penetrating the second cap membrane (SCFM); (4) a clamp (K) on the catheter line (CL), and (5) a key (SK) attached to the housing for opening the clamp (K); if the key is not fitted to the clamp (K), the clamp (K) automatically closes.; At the beginning of a session to replace dialysis fluid, the cap (SC) is fitted on the connector (F) and the clamp is closed. The housing (SL) is attached to the cap by a screwthread connection and this causes the spike (SLC) to penetrate the cap membrane (SCM) causing the sterilizing fluid to flow through the housing into the lines (LC and LS), thereby sterilizing these parts. The key (SKL) is used to open the clamp (K) causing fluid in the peritoneal cavity to flow through the device into drainage line (LS). Fresh dialysis fluid is then fed into the cavity by way of the line (LC). The clamp (K) is then closed and the cap (SC) and the housing (SL) are removed from the connector (F) and a fresh cap (SC) fitted instead.; The spike (FC) on the connector (F) penetrates the second cap membrane (SCFM), allowing sterilizing fluid to sterilize the connector and the part of catheter line (CL) up to the clamp (K).