We report on the recovery of the short-range static magnetic order and on the concomitant degradation of the superconducting state in optimally F-doped SmFe1−xRuxAsO0.85F0.15 for 0.1 ≤ x 0.5. The two reduced order parameters coexist within nanometer-size domains in the FeAs layers and finally disappear around a common critical threshold xc ∼ 0.6. Superconductivity and magnetism are shown to be closely related to two distinct well-defined local electronic environments of the FeAs layers. The two transition temperatures, controlled by the isoelectronic and diamagnetic Ru substitution, scale with the volume fraction of the corresponding environments. This fact indicates that superconductivity is assisted by magnetic fluctuations, which are frozen whenever a short-range static order appears, and totally vanish above the magnetic dilution threshold xc.The appearance of high-T c superconductivity (SC) close to the disruption of static magnetic (M) order is a general feature of the Fe-based superconductors either as a function of doping or external pressure. In the REFeAsO family (RE1111) it is found that SC and M strongly compete and hardly coexist simultaneously [1, 2], apart for RE=Sm and Ce [3,4] within a small doping range where both order parameters are depressed. Coexistence implies short range magnetic order, that is detected only by local probes such as muon-spin rotation (µSR) [4] or nuclear quadrupole resonance (NQR) [5], since it eludes long coherence probes such as powder diffraction [6]. The competition between the superconducting and magnetic ground-states must be reconciled with the prevailing models of pairing mediated by spin fluctuations [7]. These models are seemingly in contradiction with the evidence that the two mutually excluding orders coexist only when phase separation occurs.Here we show, by means of µSR and 75 As NQR, that magnetism is surprisingly still at play in optimally F-doped SmFe 1−x Ru x AsO 0.85 F 0.15 . The isoelectronic Fe:Ru substitution is found to deteriorate the superconducting state in optimally electron-doped SmFeAsO 0.85 -F 0.15 samples and simultaneously to recover static magnetism within the FeAs layers, for 0.1 ≤ x 0.5. This is accompanied by a local electronic rearrangement within the FeAs layers. When Ru doping approaches the critical threshold x c = 0.6, corresponding to percolation of a magnetic square lattice with nearest neighbor (n.n.) and next-nearest neighbor hopping, both magnetism and SC vanish.The investigated polycrystalline SmFe 1−x Ru x AsO 0.85 -F 0.15 samples are the same of Ref. 8. From 19 F nuclear magnetic resonance the relative fluorine content was found to be constant within ∆ 0.01 in the whole set of samples investigated. To investigate the bulk character of the superconducting state we carried out transverse field (TF)-µSR measurements, where a sample is fieldcooled (FC) in a magnetic field larger than the lower superconducting critical field H c1 , applied perpendicular to the initial muon-spin orientation (H ⊥ S µ ). A flux-line lattice (FLL) i...