The emotional state can influence decision-making under ambiguity. Cognitive bias tests (CBT) proved to be a promising indicator of the affective valence of animals in a context of farm animal welfare. Although it is well-known that humans can influence the intensity of fear and reactions of animals, research on cognitive bias often focusses on housing and management conditions and neglects the role of humans on emotional states of animals. The present study aimed at investigating whether humans can modulate the emotional state of weaned piglets. Fifty-four piglets received a chronic experience with humans: gentle (GEN), rough (ROU) or minimal contact (MIN). Simultaneously, they were individually trained on a go/no-go task to discriminate a positive auditory cue, associated with food reward in a trough, from a negative one, associated with punishments (e.g. water spray). Independently of the treatment (P = 0.82), 59% of piglets completed the training. Successfully trained piglets were then subjected to CBT, including ambiguous cues in presence or absence of a human observer. As hypothesized, GEN piglets showed a positive judgement bias, as shown by their higher percentage of go responses following an ambiguous cue compared to ROU (P = 0.03) and MIN (P = 0.02) piglets, whereas ROU and MIN piglets did not differ (P > 0.10). The presence of an observer during CBT did not modulate the percentage of go responses following an ambiguous cue (P > 0.10). However, regardless of the treatment, piglets spent less time in contact with the trough following positive cues during CBT in which the observer was present than absent (P < 0.0001). This study originally demonstrates that the nature of a chronic experience with humans can induce a judgement bias indicating that the emotional state of farm animals such as piglets can be affected by the way humans interact with them.