In some real situations the population of interest is divided into two groups, of which one contains only a few units. In other cases, the population may be considered as subdivided into two groups', for example, if only a few units display a value of the variable of interest which is highly different from zero, while all the other units show a value equal to or near zero. In both cases, inverse sampling is more efficient than classical fixed sample-size designs to obtain the parameter estimators for the whole population as well as for its groups (e. g., Salehi and Seber, 2004). In fact, in this design the procedure selection continues until a prefixed number of units with the characteristic of interest is sampled. Since it is not known a priori to which group the population units belong, the sample size is a random variable. Christman and Lan (2001) and Salehi and Seber (2001, 2004) considered inverse sampling designs when all the population units have equal selection probabilities. In this article, we consider the general case in which the units may have unequal probabilities of being included in the sample. In fact, in many real situations different units may have different selection probabilities because of some inherent features of the sampling procedure, or in order to obtain better estimates. We derive unbiased estimators of the totals of the two groups, their variance and the corresponding unbiased variance estimators in inverse sampling with replacement. Finally, we derive similar results for more complex designs, where the selection procedure stops before observing the prefixed number of units from the rare group.