A soft tissue graft suitable for replacing a tendon or ligament is fastened in a bone opening provided in a human or animal patient by press-fitting an end portion of the graft and a fastener into the bone opening such that the graft end portion is pressed against a first portion of the bone wall inside the bone opening. The fastener is anchored in a second portion of the bone wall by liquefying a material having thermoplastic properties by the fastener and making the fastener penetrate into the bone wall. An end portion of the graft is tied to the fastener with the aid of at least one suture extending from the graft end portion. Tying is carried out after anchoring, during anchoring or between anchoring and press-fitting. The tied connection between the fastener and the graft end portion successfully counteracts potential graft slipping.