Muhammad & Sin:-  

18: 110         Say: "I am but a man like yourselves (but) the inspiration has come to me that your Allah is one Allah: whoever expects to meet his Lord let him work righteousness and in the worship of his Lord admit no one as partner."
       *** As an ordinary human being - all be it with an extraordinary mission - Muhammad was prone to the foibles, faults, errors and sins similar to all other mortals.

       It was his later followers who created the myth andf then the dogma of a superhuman Muhammad almost an equal to the divine***

39: 30        Truly thou wilt die (one day) and truly they (too) will die (one day)

40: 55         Patiently then persevere: for the Promise of Allah is true: and ask forgiveness for thy sin (thanbika) and celebrate the Praises of thy Lord in the evening and in the morning.        
48: 1        Verily We have granted thee a manifest Victory: 2        That Allah may forgive thee thy sin (thanbika) of the past and those to follow; fulfil His favor to thee; and guide thee on the Straight Way;

62: 2         It is He Who has sent amongst the Unlettered an apostle from among themselves to rehearse to them His Signs to sanctify them and to instruct them in Scripture and Wisdom although they had been before in manifest error

       *** Collectively, these explicit and incontrovertible Quranic verses prove beyond a shadow of a doubt that Muhammad himself, far from claiming the superhuman rank and infallibility that his later followers attributed to him, knew himself as a mere mortal and prone to sin.

       It was the 'Ulamaa of Islam' who first acquired the belief - of Muhammad's supernatural characteristics - and then racked their brains for the most extraordinary and unsubstantiated arguments to support it and finally turned it into the DOGMA of  ISMA/ SINLESSNESS ***