In response to environmental stress the model cyanobacterium, Synechocystis sp. PCC6803 can switch from a planktonic state to autoaggregation and biofilm formation. The precise mechanism of this transition remains unknown. Here we investigated the role of a candidate two-component regulatory system (TCS) in controlling morphological changes, as a way to understand the intermediate molecular steps that are part of the signaling pathway. A bacterial two-hybrid assay showed that the response regulator Rre6 formed a TCS together with a split histidine kinase consisting of Hik36 and Hik43. Individual disruption mutants displayed autoaggregation in a static culture. In contrast, unlike in the wild type, high salinity did not induce biofilm formation in Δhik36, Δhik43 and Δrre6. The expression levels of exopolysaccharide (EPS) production genes were higher in Δhik36 and Δhik43, compared with the wild type, but lower in Δrre6, suggesting that the TCS regulated EPS production in Synechocystis. Rre6 interacted physically with the motor protein PilT2, that is a component of the type IV pilus system. This interaction was enhanced in a phosphomimic version of Rre6. Taken together, Hik36–Hik43–Rre6 function as an upstream component of the pili-related signal transduction cascade and control the prevention of cell adhesion and biofilm formation.