Let R be a noncommutative prime ring with the extended centroid C, I a nonzero ideal of R and g a b-generalized derivation of R. We show that, if [g(x m ), x n ] k = 0 for all x ∈ I, where m, n, k are fixed positive integers, then there exists λ ∈ C such that g(x) = λx for all x ∈ R unless R ∼ = M 2 (GF(2)), the 2 × 2 matrix ring over the Galois field GF(2) of two elements. This gives a natural generalization of the results for derivations, generalized derivations and generalized σ -derivations with an X-inner automorphism σ .