The first direct search for lepton-flavour-violating decays of the recently discovered Higgs boson (H) is described. The search is performed in the H to mu tau[e] and H to mu tau[h] channels, where tau[e] and tau[h] are tau leptons reconstructed in the electronic and hadronic decay channels, respectively. The data sample used in this search was collected in pp collisions at a centre-of-mass energy of sqrt(s) = 8 TeV with the CMS experiment at the CERN LHC and corresponds to an integrated luminosity of 19.7 inverse femtobarns. The sensitivity of the search is an order of magnitude better than the existing indirect limits. A slight excess of signal events with a significance of 2.4 standard deviations is observed. The p-value of this excess at M[H] = 125 GeV is 0.010. The best fit branching fraction is B(H to mu tau) = (0.84 +0.39 -0.37)%. A constraint on the branching fraction, B(H to mu tau) < 1.51% at 95% confidence level is set. This limit is subsequently used to constrain the mu-tau Yukawa couplings to be less than 3.6E-3.