We consider the fundamental problem of assigning distinct labels to agents in the probabilistic model of population protocols. In this distributed model, during each consecutive step the random scheduler draws uniformly at random a pair from the population of n identical agents. The two chosen agents interact and on the conclusion of the step they update their states according to the predefined transition function. This function is designed to allow agents to solve the considered shared computational task. Our protocols operate under the assumption that the size n of the population is embedded in the transition function. In addition, our solutions rely on a unique leader which can be precomputed with a negligible impact on our upper bounds. The efficiency of our protocols is expressed in terms of the number of states utilized by agents, the size of the range from which the labels are drawn, and the expected number of interactions required by our solutions. Among other things, we consider silent labeling protocols, where eventually each agent reaches its final state and remains in it forever, as well as safe labeling protocols which (i) can produce a valid agent labeling in a finite number of interactions, and (ii) guarantee that at any step of the protocol no two agents have the same label. We first focus on labeling silent or safe protocols which use very small number of states and labels from range 1, . . . , n. We provide a silent and safe protocol which uses only n + 5 √ n + 4 states. The expected number of interactions required by the protocol is O(n 3 ). On the other hand, we show that any safe protocol, as well as any silent protocol which provides a valid labeling with probability > 1 − 1 n , uses at least n+ √ n−1 states. It follows that our protocol is almost state-optimal. In addition, we present a variant of this protocol which uses n(1 + ε) states. The expected number of interactions required by this variation is O(n 2 /ε 2 ), where ε = Ω(n −1/2 ). On the other hand, we show that for any safe labeling protocol utilizing n+t < 2n states the expected number of interactions required to achieve a valid labeling is at least n 2 t+1 . We show also an analogous lower bound on the expected number of interactions for any silent labeling protocol which provides a valid labeling with probability 1. Next, we present a fast labeling protocol for which the required number of interactions is asymptotically optimal, i.e., O(n log n), with high probability. It uses