BackgroundIn primary health care people with mental health needs are often overlooked or masked with physical complaints. It has been suggested that public health nurses lack sufficient knowledge when encountering people with mental health problems. Low levels of mental health literacy among professionals are associated with negative patient outcome. There is a need to understand public health nurses process and strategies used when encountering a person with mental health problems in order to promote mental health. This study aimed to construct a theory that explains the process of public health nurses experience when encountering people with mental health problems based on their knowledge, attitudes, and beliefs about mental health.MethodsA constructivist grounded theory design was used to meet the aim of the study. Interviews were conducted with 13 public health nurses working in primary health care between October 2019 and June 2021, and the data analysis was performed according to the principles of Charmaz.ResultsThe core category,“Public health nurses as a relationship builder – to initiate the dialogue”reflected the process while the main categories “Being on your own”,“Being on top of things- knowing your limits”, and “Professional comfort zone”reflected conditions that were decisive for initiating a dialogue.ConclusionManaging mental health encounters in primary health care was a personal and complex decision-making process that depends on the public health nurses’ professional comfort zone and acquired mental health literacy. Narratives of the public health nurses helped to construct a theory and understand the conditions for recognizing, managing and promoting mental health in primary health care.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12912-023-01340-7.