UE Context Release Command is the NGAP message the AMF sends to NG-RAN to order release of the UE-associated logical NG connection and associated access-side context.
AMF decides the current UE-associated NG connection must be released because a transaction ended, setup failed, duplicate context exists, mobility changed the serving connection, or recovery/cleanup is required.
Main purpose
Orders NG-RAN to release the UE-associated logical NG connection so stale, failed, duplicated, or no-longer-needed UE context can be cleaned up in a controlled way.
UE Context Release, Failure recovery and cleanup, Duplicate connection removal, Mobility and re-establishment cleanup
What is UE Context Release Command in simple terms?
UE Context Release Command is the NGAP message the AMF sends to NG-RAN to order release of the UE-associated logical NG connection and associated access-side context.
Orders NG-RAN to release the UE-associated logical NG connection so stale, failed, duplicated, or no-longer-needed UE context can be cleaned up in a controlled way.
Why this message matters
UE Context Release Command is the AMF telling the gNB to tear down the current UE-associated NG connection and clear the related access-side context.
Where this message appears in the call flow
Cleanup after failed context setup
Failure cleanup branch: AMF orders NG-RAN to remove unusable or partial UE context.
Call flow position: AMF cleanup branch after setup failed or continuation became impossible, and the old or partial UE context must be cleared from NG-RAN.
Typical state: UE context may be partially created, inconsistent, or no longer useful for service continuation.
Preconditions:
AMF has a mapped UE context at NG-RAN.
AMF determined release is safer than retrying on the same context.
Next likely message: UE Context Release Complete
Old connection replacement after re-establishment
Replacement branch: the stale UE-associated NG connection is explicitly removed after a newer path exists.
Call flow position: AMF orders release of an older UE-associated NG connection when a newer access connection has superseded it.
Typical state: A stale or duplicate access-side context exists and must be removed to prevent split state.
Preconditions:
AMF identified an obsolete UE-associated NG connection.
A newer valid context or re-established signaling path exists.
Next likely message: UE Context Release Complete or fresh UE signaling on the new path
Normal service cleanup or reachability transition
Normal cleanup branch: AMF closes the UE-associated NG connection after transaction completion or state transition.
Call flow position: AMF explicitly releases context when the current transaction has ended or the access-side connection no longer needs to stay active.
Typical state: Core procedure completed, and UE-associated NG signaling context should be removed from NG-RAN.
Preconditions:
AMF has decided to terminate the current NG connection state.
Release cause is available for NG-RAN interpretation.
Transport / encapsulation: NGAP over SCTP/IP between AMF and NG-RAN
Security context: The command does not establish new security; it terminates an existing access-side context that was previously bound to AMF and NG-RAN UE identities.
Message Structure Overview
UE Context Release Command is the AMF-to-NG-RAN control message in the UE Context Release procedure.
The message payload is intentionally small: identify the UE-associated NG connection and provide the release cause.
Operationally, this message matters because it is the explicit cleanup order that precedes UE Context Release Complete.
ASN.1 for 5G NGAP - UE Context Release Command
UEContextReleaseCommand ::= SEQUENCE {
protocolIEs ProtocolIE-Container { {UEContextReleaseCommand-IEs} },
...
}
UEContextReleaseCommand-IEs NGAP-PROTOCOL-IES ::= {
{ ID id-UE-NGAP-IDs CRITICALITY reject TYPE UE-NGAP-IDs PRESENCE mandatory } |
{ ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory },
...
}
How to read this ASN.1
Decode UE NGAP IDs first so you know which access-side context is being targeted. Then read Cause to understand why AMF wants that context removed.
5G NGAP - UE Context Release Command - Example Dump
UE NGAP IDs identify the exact logical NG connection to remove; verify both sides of the pair before interpreting anything else.
Cause defines whether the release is ordinary cleanup, failure recovery, stale-connection removal, or another exceptional branch.
This command is usually not the root cause itself; it is often the AMF decision taken after another problem or state transition.
Important Information Elements
IE
Required
Description
UE NGAP IDs
Yes
Mandatory UE identity container that carries the AMF and NG-RAN UE identifiers needed to select the exact UE-associated NG connection to release.
Cause
Yes
Mandatory release reason that tells NG-RAN why AMF is ordering release of the UE context.
Detailed field explanation
UE NGAP IDs
Mandatory UE identity container that carries the AMF and NG-RAN UE identifiers needed to select the exact UE-associated NG connection to release.
Presence: Required
In practice: In practice, compare this field with the original request and with any later release-dependent optional fields so you can see whether the network accepted the same service model the UE asked for.
Cause
Mandatory release reason that tells NG-RAN why AMF is ordering release of the UE context.
Presence: Required
In practice: In practice, compare this field with the original request and with any later release-dependent optional fields so you can see whether the network accepted the same service model the UE asked for.
What to check in logs and traces
Correlate UE NGAP IDs with the latest successful or failed procedure involving this UE context.
Read Cause and determine whether AMF is cleaning up after failure, mobility, duplicate connection, or normal transaction completion.
Verify NG-RAN responds with UE Context Release Complete for the same UE NGAP ID mapping.
If a new UE context already exists elsewhere, confirm the command is targeting only the stale connection and not the active one.
Check whether release follows a known trigger such as Initial Context Setup Failure, NAS delivery failure, handover cleanup, or UE re-establishment.
Common Issues and Troubleshooting
AMF sends UE Context Release Command but NG-RAN does not free the expected context.
Likely cause: UE NGAP IDs may not match the currently active NG-RAN mapping, or the command may be targeting a different stale context than expected.
What to inspect: Compare UE NGAP IDs with earlier setup, mobility, and re-establishment traces before assuming release failure.
Next step: Validate identity mapping first, then confirm whether UE Context Release Complete was sent for the same pair.
A UE is released even though service looked healthy.
Likely cause: AMF may be removing an old duplicate connection after a newer one was established, or it may be closing context after transaction completion.
What to inspect: Look for a fresh Initial UE Message, re-registration, or mobility event that created a replacement context.
Next step: Treat the command as state cleanup unless the cause and timing show unintended release.
Repeated release commands appear around setup or paging failures.
Likely cause: AMF is likely using explicit cleanup to clear unusable context after unsuccessful continuation attempts.
What to inspect: Correlate the release command with preceding Initial Context Setup Failure, NAS Non Delivery Indication, or missing UE response branches.
Next step: Fix the underlying setup or reachability issue before expecting stable new context establishment.
LTE / 5G / Variant Comparison
Compared with UE Context Release Complete
Command is the AMF instruction to release context. Complete is the NG-RAN confirmation that the targeted logical NG connection has been removed.
Compared with Initial Context Setup Failure
Initial Context Setup Failure reports that setup could not complete. UE Context Release Command is the later AMF cleanup decision that may follow that failure.
Compared with NAS Non Delivery Indication
NAS Non Delivery Indication reports failed delivery of one downlink NAS message. UE Context Release Command ends the entire UE-associated NG connection when AMF decides cleanup is required.
FAQ
What is UE Context Release Command in 5G NGAP?
It is the AMF-to-NG-RAN message that orders release of the UE-associated logical NG connection.
What are the key IEs in UE Context Release Command?
The command carries UE NGAP IDs to identify the target connection and a Cause IE to explain why release is being ordered.
What usually comes after UE Context Release Command?
NG-RAN normally answers with UE Context Release Complete for the same UE context.
Is UE Context Release Command itself the root cause of a failure?
Usually no. It is often the cleanup action AMF takes after some earlier setup, reachability, or duplicate-context problem.
Decode this message with the 3GPP Decoder, inspect the related message database, or open the matching call flow to see where this signaling step fits in the full procedure.