Let p be a prime dividing the order of a finite group G, and P be a Sylow p-subgroup of G. In this paper, we prove that G is p-nilpotent if \(N_{G}(P)\) is p-nilpotent and there is a subgroup H of P with \(P'\le H\le \Phi (P)\) such that \(H\cap O^{p}(G_{p}^{*})\) is s-semipermutable or s-permutably embedded in G. Our result generalizes some main theorems of Liu et al. (Monatsh. Math. 195(1): 173–176, 2021), and Aseeri et al. (Comm. Algebra 51(5): 2176–2182, 2023). Applying our result, we study the structure of finite groups from the viewpoint of the coprime action. More precisely, we not only simplify, but also improve some main theorems of Beltr \(\acute{a}\) n et al. (Acta Math Hungar 171(1):39–52, 2023), and Zhang et al. (Comm Algebra 53(3):994–1003, 2025).